diff --git a/vlib/builtin/builtin_windows.c.v b/vlib/builtin/builtin_windows.c.v index 239d87b80b..160a3fe9bb 100644 --- a/vlib/builtin/builtin_windows.c.v +++ b/vlib/builtin/builtin_windows.c.v @@ -70,7 +70,7 @@ fn restore_codepage() { fn builtin_init() { g_original_codepage = C.GetConsoleOutputCP() - C.SetConsoleOutputCP(C.CP_UTF8) + C.SetConsoleOutputCP(C.CP_UTF8) C.atexit(restore_codepage) if is_atty(1) > 0 { C.SetConsoleMode(C.GetStdHandle(C.STD_OUTPUT_HANDLE), C.ENABLE_PROCESSED_OUTPUT | 0x0004) // enable_virtual_terminal_processing @@ -201,9 +201,9 @@ pub: type VectoredExceptionHandler fn(&ExceptionPointers)u32 -fn C.AddVectoredExceptionHandler(u32, VectoredExceptionHandler) +fn C.AddVectoredExceptionHandler(u32, C.PVECTORED_EXCEPTION_HANDLER) fn add_vectored_exception_handler(handler VectoredExceptionHandler) { - C.AddVectoredExceptionHandler(1, handler) + C.AddVectoredExceptionHandler(1, C.PVECTORED_EXCEPTION_HANDLER(handler)) } [windows_stdcall] diff --git a/vlib/builtin/cfns.c.v b/vlib/builtin/cfns.c.v index 3fc4e35dbf..214189a48a 100644 --- a/vlib/builtin/cfns.c.v +++ b/vlib/builtin/cfns.c.v @@ -221,7 +221,7 @@ fn C.SendMessageTimeoutW(hWnd voidptr, Msg u32, wParam &u16, lParam &u32, fuFlag fn C.CreateProcessW(lpApplicationName &u16, lpCommandLine &u16, lpProcessAttributes voidptr, lpThreadAttributes voidptr, bInheritHandles bool, dwCreationFlags u32, lpEnvironment voidptr, lpCurrentDirectory &u16, lpStartupInfo voidptr, lpProcessInformation voidptr) bool -fn C.ReadFile(hFile voidptr, lpBuffer voidptr, nNumberOfBytesToRead u32, lpNumberOfBytesRead voidptr, lpOverlapped voidptr) bool +fn C.ReadFile(hFile voidptr, lpBuffer voidptr, nNumberOfBytesToRead u32, lpNumberOfBytesRead C.LPDWORD, lpOverlapped voidptr) bool fn C.GetFileAttributesW(lpFileName byteptr) u32 diff --git a/vlib/os/os.v b/vlib/os/os.v index c689e4f957..f3115e005e 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -691,13 +691,13 @@ pub fn get_raw_line() string { h_input := C.GetStdHandle(std_input_handle) mut bytes_read := 0 if is_atty(0) > 0 { - C.ReadConsole(h_input, buf, max_line_chars * 2, &bytes_read, 0) + C.ReadConsole(h_input, buf, max_line_chars * 2, C.LPDWORD(&bytes_read), 0) return string_from_wide2(&u16(buf), bytes_read) } mut offset := 0 for { pos := buf + offset - res := C.ReadFile(h_input, pos, 1, &bytes_read, 0) + res := C.ReadFile(h_input, pos, 1, C.LPDWORD(&bytes_read), 0) if !res || bytes_read == 0 { break } @@ -734,7 +734,7 @@ pub fn get_raw_stdin() []byte { mut offset := 0 for { pos := buf + offset - res := C.ReadFile(h_input, pos, block_bytes, &bytes_read, 0) + res := C.ReadFile(h_input, pos, block_bytes, C.LPDWORD(&bytes_read), 0) offset += bytes_read if !res { diff --git a/vlib/os/os_windows.c.v b/vlib/os/os_windows.c.v index 1f0adf07d4..1ede7381a8 100644 --- a/vlib/os/os_windows.c.v +++ b/vlib/os/os_windows.c.v @@ -345,7 +345,7 @@ pub type VectoredExceptionHandler fn(&ExceptionPointers)u32 // fn C.AddVectoredExceptionHandler(u32, VectoredExceptionHandler) pub fn add_vectored_exception_handler(first bool, handler VectoredExceptionHandler) { - C.AddVectoredExceptionHandler(u32(first), handler) + C.AddVectoredExceptionHandler(u32(first), C.PVECTORED_EXCEPTION_HANDLER(handler)) } // this is defined in builtin_windows.c.v in builtin