@@ -4,13 +4,13 @@ import strings
4
4
5
5
fn C.GenerateConsoleCtrlEvent (event u32 , pgid u32 ) bool
6
6
fn C.GetModuleHandleA (name & char) HMODULE
7
- fn C.GetProcAddress (handle voidptr , procname & byte ) voidptr
7
+ fn C.GetProcAddress (handle voidptr , procname & u8 ) voidptr
8
8
fn C.TerminateProcess (process HANDLE, exit_code u32 ) bool
9
9
fn C.PeekNamedPipe (hNamedPipe voidptr , lpBuffer voidptr , nBufferSize int , lpBytesRead voidptr , lpTotalBytesAvail voidptr , lpBytesLeftThisMessage voidptr ) bool
10
10
11
11
type FN_NTSuspendResume = fn (voidptr )
12
12
13
- fn ntdll_fn (name & char ) FN_NTSuspendResume {
13
+ fn ntdll_fn (name & byte ) FN_NTSuspendResume {
14
14
ntdll := C.GetModuleHandleA (c 'NTDLL' )
15
15
if ntdll == 0 {
16
16
return FN_NTSuspendResume (0 )
@@ -47,7 +47,7 @@ fn close_valid_handle(p voidptr) {
47
47
pub struct WProcess {
48
48
pub mut :
49
49
proc_info ProcessInformation
50
- command_line [65536 ]byte
50
+ command_line [65536 ]u8
51
51
child_stdin & u32
52
52
//
53
53
child_stdout_read & u32
@@ -198,7 +198,7 @@ fn (mut p Process) win_read_string(idx int, maxbytes int) (string, int) {
198
198
}
199
199
200
200
mut bytes_read := int (0 )
201
- buf := []byte {len: bytes_avail + 300 }
201
+ buf := []u8 {len: bytes_avail + 300 }
202
202
unsafe {
203
203
C.ReadFile (rhandle, & buf[0 ], buf.cap, voidptr (& bytes_read), 0 )
204
204
}
@@ -221,7 +221,7 @@ fn (mut p Process) win_slurp(idx int) string {
221
221
return ''
222
222
}
223
223
mut bytes_read := u32 (0 )
224
- buf := [4096 ]byte {}
224
+ buf := [4096 ]u8 {}
225
225
mut read_data := strings.new_builder (1024 )
226
226
for {
227
227
mut result := false
0 commit comments