hi i have the big problem, that I cant overgive a parameter:




INVOKE CreateThread ...,Threadprocess, ,...

[...]
Threadprocess PROC anyvar0:DWORD
LOCAL anyvar:DWORD
LOCAL anywar1:DWORD

PUSH anywar
PUSH anywar1
CALL anyvar0

RET
Threadprocess ENDP

Funktion PROC anyvar1:DWORD, anywar:DWORD
[...]
Funktion ENDP



How to make it right? - I get only the same value's and soemites the half value

Bye!
Posted on 2003-06-07 13:48:08 by Forginforcer
Funktion_struc STRUCT

anywar0 DWORD ?
anywar DWORD ?
anywar1 DWORD ?
Funktion_struc ENDS

Funktion PROC anyvar1:DWORD, anywar:DWORD
[...]
Funktion ENDP


Threadprocess PROC anyvar0:DWORD
LOCAL anyvar:DWORD
LOCAL anywar1:DWORD

mov eax, anyvar0
PUSH [eax].Funktion_struc.anywar
PUSH [eax].Funktion_struc.anywar1
CALL [eax].Funktion_struc.anywar0

RET
Threadprocess ENDP


[...]

mov ebx, anyvar0
PUSH [ebx].Funktion_struc.anywar, val
PUSH [ebx].Funktion_struc.anywar1, val1
mov [ebx].Funktion_struc.anywar0, OFFSET Funktion

[...]

invoke CreateThread, NULL, 4096, OFFSET Threadprocess, ebx,
NULL, ADDR [ebx].THREAD_BLOCK.ThreadId
mov [ebx].THREAD_BLOCK.hThread, eax
Create some global data for a thread struct and pass the pointer.
Posted on 2003-06-07 14:25:02 by bitRAKE
hmm, thats a bad solution. isnt' it ?
Posted on 2003-06-07 14:38:49 by Forginforcer
Here an example of passing data to a thread:
http://www.asmcommunity.net/board/index.php?topic=13727
Posted on 2003-06-07 15:27:04 by bitRAKE
or how its possible to declare a function as extern?
Posted on 2003-06-07 15:30:57 by Forginforcer
Posted on 2003-06-07 16:24:01 by bitRAKE