Kernel32CreateThread(IntPtr, IntPtr, IntPtr, IntPtr, CreateThreadFlags, UInt32) Method
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static IntPtr CreateThread(
IntPtr threadAttributes,
IntPtr stackSize,
IntPtr startAddress,
IntPtr threadParameter,
CreateThreadFlags creationFlags,
ref uint refThreadId
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Auto, SetLastError := true>]
Public Shared Function CreateThread (
threadAttributes As IntPtr,
stackSize As IntPtr,
startAddress As IntPtr,
threadParameter As IntPtr,
creationFlags As CreateThreadFlags,
ByRef refThreadId As UInteger
) As IntPtr
Dim threadAttributes As IntPtr
Dim stackSize As IntPtr
Dim startAddress As IntPtr
Dim threadParameter As IntPtr
Dim creationFlags As CreateThreadFlags
Dim refThreadId As UInteger
Dim returnValue As IntPtr
returnValue = Kernel32.CreateThread(threadAttributes,
stackSize, startAddress, threadParameter,
creationFlags, refThreadId)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Auto, SetLastError = true)]
static IntPtr CreateThread(
IntPtr threadAttributes,
IntPtr stackSize,
IntPtr startAddress,
IntPtr threadParameter,
CreateThreadFlags creationFlags,
unsigned int% refThreadId
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)>]
static member CreateThread :
threadAttributes : IntPtr *
stackSize : IntPtr *
startAddress : IntPtr *
threadParameter : IntPtr *
creationFlags : CreateThreadFlags *
refThreadId : uint32 byref -> IntPtr
No code example is currently available or this language may not be supported.
- threadAttributes IntPtr
-
A pointer to a SecurityAttributes structure that determines whether the
returned handle can be inherited by child processes.
If threadAttributes is Zero, the handle cannot be inherited.
The SecurityDescriptor member of the structure specifies a
security descriptor for the new thread.
If threadAttributes is Zero, the thread gets a default security descriptor.
The ACLs in the default security descriptor for a thread come from the primary token of the creator.
- stackSize IntPtr
-
The initial size of the stack, in bytes. The system rounds this value to the nearest page.
If this parameter is zero, the new thread uses the default size for the executable.
- startAddress IntPtr
-
A pointer to the application-defined function to be executed by the thread.
This pointer represents the starting address of the thread.
- threadParameter IntPtr
-
A pointer to a variable to be passed to the thread.
- creationFlags CreateThreadFlags
-
The flags that control the creation of the thread.
- refThreadId UInt32
-
A pointer to a variable that receives the thread identifier.
If this parameter is , the thread identifier is not returned.
IntPtr
If the function succeeds, the return value is a handle to the new thread.
If the function fails, the return value is
Zero.
To get extended error information, call
GetLastWin32Error.