Skip to content

Commit e3f6ad0

Browse files
committed
Pass a pointer lpThreadId to CreateThread instead of a null pointer
This parameter must not be null on 9X/ME.
1 parent 2eca161 commit e3f6ad0

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
@@ -31,13 +31,17 @@ impl Thread {
3131
// PTHREAD_STACK_MIN bytes big. Windows has no such lower limit, it's
3232
// just that below a certain threshold you can't do anything useful.
3333
// That threshold is application and architecture-specific, however.
34+
35+
// this is needed on 9X/ME - passing null_mut() is not allowed
36+
let mut thread_id = 0;
37+
3438
let ret = c::CreateThread(
3539
ptr::null_mut(),
3640
stack,
3741
Some(thread_start),
3842
p as *mut _,
3943
c::STACK_SIZE_PARAM_IS_A_RESERVATION,
40-
ptr::null_mut(),
44+
&mut thread_id,
4145
);
4246
let ret = HandleOrNull::from_raw_handle(ret);
4347
return if let Ok(handle) = ret.try_into() {

0 commit comments

Comments
 (0)