it doesn't matter what you give to lpThreadId as long as it's a valid pointer and you don't care to use the data it returns. What are you using hte semaphore for? If you want to use it to synchronize the threads then you will have to use the same for all them. I usually use CriticalSections for synchronizing, but with a semaphore you can specify how many threads are able to access the same code at the same time, I've never had a reason to let more than one thread access a critical section at the same time though.