how can i define a procedure that fills up a structure with some string fields in masm,
provided that the procedure invokes some other functions to fill each field?
i need to call the procedure from c.
example:
MYSTRUCT STRUCT
str1 BYTE 10 dup(?)
str2 BYTE 10 dup(?)
MYSTRUCT ENDS
myproc PROC STDCALL pMyStruct:DWORD
push ebx
lea ebx, pMyStruct
invoke FillStringProcedure, addr [ebx].MYSTRUCT.str1
invoke FillStringProcedure, addr [ebx].MYSTRUCT.str1
pop ebx
ret
myproc endp
FillStringProcedure fills up a string from a given pointer
thankyou.
lea ebx, pMyStruct
this load the variables address, not the content (which is the pointer)
-->
mov ebx,pMyStruct
MYSTRUCT STRUCT
str1 BYTE 10 dup(?)
str2 BYTE 10 dup(?)
MYSTRUCT ENDS
mystruct MYSTRUCT {}
invoke MessageBox ,0, addr mystruct.str1, addr mystruct.str2,0