1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

more windows fixes + bring back windows ci

This commit is contained in:
Alexander Medvednikov
2020-04-02 13:44:46 +02:00
parent 1178bfa578
commit 5b835d294c
6 changed files with 28 additions and 30 deletions

View File

@@ -2,7 +2,7 @@ module os
// Ref - winnt.h
const (
SUCCESS = 0 // ERROR_SUCCESS
success = 0 // ERROR_SUCCESS
ERROR_INSUFFICIENT_BUFFER = 130
)
@@ -77,7 +77,7 @@ const (
ENABLE_INSERT_MODE = 0x0020
ENABLE_LINE_INPUT = 0x0002
ENABLE_MOUSE_INPUT = 0x0010
ENABLE_PROCESSED_INPUT = 0x0001
ENABLE_PROCESSED_INPUT = 0x0001
ENABLE_QUICK_EDIT_MODE = 0x0040
ENABLE_WINDOW_INPUT = 0x0008
ENABLE_VIRTUAL_TERMINAL_INPUT = 0x0200

View File

@@ -198,14 +198,13 @@ pub fn get_file_handle(path string) HANDLE {
// get_module_filename retrieves the fully qualified path for the file that contains the specified module.
// The module must have been loaded by the current process.
pub fn get_module_filename(handle HANDLE) ?string {
success := C.SUCCESS
unsafe {
mut sz := 4096 // Optimized length
mut buf := &u16(malloc(4096))
for {
status := int(C.GetModuleFileNameW(handle, voidptr(&buf), sz))
match status {
success {
os.success {
_filename := string_from_wide2(buf, sz)
return _filename
}