Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 241 of file dthread.c.
Referenced by WsThreadGetCurrentThread().
{ PWSTHREAD Thread = NULL; INT ErrorCode = WSASYSCALLFAILURE; /* Make sure we have TLS */ if (TlsIndex != TLS_OUT_OF_INDEXES) { /* Allocate the thread */ if ((Thread = WsThreadAllocate())) { /* Initialize it */ if (WsThreadInitialize(Thread, Process) == ERROR_SUCCESS) { /* Set the TLS */ if (TlsSetValue(TlsIndex, Thread)) { /* Return it and success */ *CurrentThread = Thread; ErrorCode = ERROR_SUCCESS; } } /* Check for any failures */ if (ErrorCode != ERROR_SUCCESS) WsThreadDelete(Thread); } } /* Return */ return ErrorCode; }