invoke CreateThread, 0, 0, OFFSET CheckPort, addr SPTS_temp, 0, NULL

the handle for the CT is NULL, that cused errors when i call this severel times.
If you are running Win9x, the last parameter must not be NULL. Try the following:

.data
NewThreadId DWORD ?

.code
invoke CreateThread, 0, 0, OFFSET CheckPort, addr SPTS_temp, 0, addr NewThreadId
Posted on 2003-06-02 18:02:47 by tenkey
i have the whole crap in a loop i need a dynamic array...:confused: :confused: :confused: :confused:
Posted on 2003-06-03 07:38:35 by Forginforcer
Red,
What exactly do you mean by dynamic array? Could you explain yourself?
Posted on 2003-06-03 07:42:49 by roticv
If you want to create five threads and keep their handles, you can do this:

.data
ThreadArray DWORD 5 dup(NULL)

.code
invoke CreateThread,...
mov ThreadArray+0*4,eax

invoke CreateThread,...
mov ThreadArray+1*4,eax

invoke CreateThread,...
mov ThreadArray+2*4,eax

invoke CreateThread,...
mov ThreadArray+3*4,eax

invoke CreateThread,...
mov ThreadArray+4*4,eax

=====

The thread indexes will be from 0 to 4, and to get a specific handle you do the following:

mov ecx,nIndex ; Get index from somewhere
mov eax,ThreadArray[4*ecx] ; Get thread handle into EAX
Posted on 2003-06-03 19:56:06 by tenkey