1、谁能比较详细的解释一下函数CreateKernelThread(),用它创建的线程到底在哪个进程中?我能随便指个进程让它在其中创建线程吗?
2、在win9x中如何根据线程ID得到该线程的handle?(用CreateKernelThread()创建的线程)
谢谢!

解决方案 »

  1.   

    Win32的线程函数列举如下:并没有楼主所说的CreateKernelThread()函数,你的这个函数是不是别人写的一个函数啊!能看看他的代码吗?
    AttachThreadInput :Attaches the input processing mechanism of one thread to that of another thread. 
    CreateRemoteThread :Creates a thread that runs in the virtual address space of another process. 
    CreateThread :Creates a thread to execute within the virtual address space of the calling process. 
    ExitThread :Ends a thread. 
    GetCurrentThread :Retrieves a pseudo handle for the current thread. 
    GetCurrentThreadId :Retrieves the thread identifier of the calling thread. 
    GetExitCodeThread :Retrieves the termination status of the specified thread. 
    GetThreadPriority :Retrieves the priority value for the specified thread. 
    GetThreadPriorityBoost :Retrieves the priority boost control state of the specified thread. 
    GetThreadTimes :Retrieves timing information for the specified thread. 
    OpenThread Opens an existing thread object. 
    ResumeThread :Decrements a thread's suspend count. 
    SetThreadAffinityMask :Sets a processor affinity mask for the specified thread. 
    SetThreadIdealProcessor :Specifies a preferred processor for a thread. 
    SetThreadPriority :Sets the priority value for the specified thread. 
    SetThreadPriorityBoost :Disables the ability of the system to temporarily boost the priority of a thread. 
    Sleep :Suspends the execution of the current thread for a specified interval. 
    SleepEx :Suspends the current thread until the specified condition is met. 
    SuspendThread :Suspends the specified thread. 
    SwitchToThread :Causes the calling thread to yield execution to another thread that is ready to run on the current processor. 
    TerminateThread :Terminates a thread. 
    ThreadProc :An application-defined function that serves as the starting address for a thread. 
    TlsAlloc :Allocates a thread local storage (TLS) index. 
    TlsFree :Releases a TLS index. 
    TlsGetValue :Retrieves the value in the calling thread's TLS slot for a specified TLS index. 
    TlsSetValue :Stores a value in the calling thread's TLS slot for a specified TLS index. 
    WaitForInputIdle :Waits until the specified process is waiting for user input with no input pending, or until the time-out interval has elapsed.
      

  2.   

    MSDN中没有你这个函数,是不是别人写的?
      

  3.   

    呵呵,怎么会这样???????/是kernel32.dll中的一个未公开的函数,我已经有办法了,谢谢大家!