Skip to content

Commit 8e610b2

Browse files
seritoolsmbilker
authored andcommitted
Pass a pointer lpThreadId to CreateThread instead of a null pointer
This parameter must not be null on 9X/ME.
1 parent c999188 commit 8e610b2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

library/std/src/sys/windows/thread.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@ impl Thread {
3030
// PTHREAD_STACK_MIN bytes big. Windows has no such lower limit, it's
3131
// just that below a certain threshold you can't do anything useful.
3232
// That threshold is application and architecture-specific, however.
33+
34+
// this is needed on 9X/ME - passing null_mut() is not allowed
35+
let mut thread_id = 0;
36+
3337
let ret = c::CreateThread(
3438
ptr::null_mut(),
3539
stack,
3640
Some(thread_start),
3741
p as *mut _,
3842
c::STACK_SIZE_PARAM_IS_A_RESERVATION,
39-
ptr::null_mut(),
43+
&mut thread_id,
4044
);
4145
let ret = HandleOrNull::from_raw_handle(ret);
4246
return if let Ok(handle) = ret.try_into() {

0 commit comments

Comments
 (0)