@@ -87,7 +87,7 @@ mod imp {
87
87
// use job objects, so we instead just ignore errors and assume that
88
88
// we're otherwise part of someone else's job object in this case.
89
89
90
- let job = CreateJobObjectW ( ptr:: null_mut ( ) , ptr:: null ( ) ) ;
90
+ let job = unsafe { CreateJobObjectW ( ptr:: null_mut ( ) , ptr:: null ( ) ) } ;
91
91
if job == INVALID_HANDLE_VALUE {
92
92
return None ;
93
93
}
@@ -98,22 +98,24 @@ mod imp {
98
98
// entire process tree by default because we've added ourselves and
99
99
// our children will reside in the job once we spawn a process.
100
100
let mut info: JOBOBJECT_EXTENDED_LIMIT_INFORMATION ;
101
- info = mem:: zeroed ( ) ;
101
+ info = unsafe { mem:: zeroed ( ) } ;
102
102
info. BasicLimitInformation . LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE ;
103
- let r = SetInformationJobObject (
104
- job. inner ,
105
- JobObjectExtendedLimitInformation ,
106
- addr_of ! ( info) as * const _ ,
107
- mem:: size_of_val ( & info) as u32 ,
108
- ) ;
103
+ let r = unsafe {
104
+ SetInformationJobObject (
105
+ job. inner ,
106
+ JobObjectExtendedLimitInformation ,
107
+ addr_of ! ( info) as * const _ ,
108
+ mem:: size_of_val ( & info) as u32 ,
109
+ )
110
+ } ;
109
111
if r == 0 {
110
112
return None ;
111
113
}
112
114
113
115
// Assign our process to this job object, meaning that our children will
114
116
// now live or die based on our existence.
115
- let me = GetCurrentProcess ( ) ;
116
- let r = AssignProcessToJobObject ( job. inner , me) ;
117
+ let me = unsafe { GetCurrentProcess ( ) } ;
118
+ let r = unsafe { AssignProcessToJobObject ( job. inner , me) } ;
117
119
if r == 0 {
118
120
return None ;
119
121
}
0 commit comments