hi, how do i properly declare following types of structure members?
- pointer to another structure
- pointer to procedure
of course i can just make them DWORDS, but i wonder if there is better type (more explicit) for these.
...
;; procedure prototype and pointer
myproc proto :dword,:dword
pmyproc typedef ptr myproc
;; structure definition and pointer
MYSTRUCT struct
MYSTRUCT ends
PMYSTRUCT typedef ptr MYSTRUCT
OTHERSTRUCT struct
 pmy PMYSTRUCT ?
 pp pmyproc ?
OTHERSTRUCT ends
POTHERSTRUCT typedef ptr OTHERSTRUCT
;;usage:
myother proc param:pmyproc
;; dummy code
invoke param,0,0 ;; this is why masm rocks
assume edi:POTHERSTRUCT
invoke [edi].pp,0,0 ;; this is why masm rocks
assume edi:nothing
ret
myother endp
Quote from: drizz on November 07, 2007, 10:23:30 PM
;; procedure prototype and pointer
myproc proto :dword,:dword
pmyproc typedef ptr myproc
;; structure definition and pointer
MYSTRUCT struct
MYSTRUCT ends
PMYSTRUCT typedef ptr MYSTRUCT
OTHERSTRUCT struct
 pmy PMYSTRUCT ?
 pp pmyproc ?
OTHERSTRUCT ends
POTHERSTRUCT typedef ptr OTHERSTRUCT
;;usage:
myother proc param:pmyproc
;; dummy code
invoke param,0,0 ;; this is why masm rocks
assume edi:POTHERSTRUCT
invoke [edi].pp,0,0 ;; this is why masm rocks
assume edi:nothing
ret
myother endp
:dazzled: OMG, you have no idea how invaluable this is for me at this very moment. Thank you once again drizz :U
assume edi:POTHERSTRUCT
invoke [edi].pp,0,0 ;; this is why masm rocks
or you could do without ASSUME :
invoke POTHERSTRUCT.pp[edi],0,0
thanks drizz