mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
windows: a temp SUCCESS fix
This commit is contained in:
@ -198,13 +198,14 @@ pub fn get_file_handle(path string) HANDLE {
|
|||||||
// get_module_filename retrieves the fully qualified path for the file that contains the specified module.
|
// 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.
|
// The module must have been loaded by the current process.
|
||||||
pub fn get_module_filename(handle HANDLE) ?string {
|
pub fn get_module_filename(handle HANDLE) ?string {
|
||||||
|
success := C.SUCCESS
|
||||||
unsafe {
|
unsafe {
|
||||||
mut sz := 4096 // Optimized length
|
mut sz := 4096 // Optimized length
|
||||||
mut buf := &u16(malloc(4096))
|
mut buf := &u16(malloc(4096))
|
||||||
for {
|
for {
|
||||||
status := int(C.GetModuleFileNameW(handle, voidptr(&buf), sz))
|
status := int(C.GetModuleFileNameW(handle, voidptr(&buf), sz))
|
||||||
match status {
|
match status {
|
||||||
SUCCESS {
|
success {
|
||||||
_filename := string_from_wide2(buf, sz)
|
_filename := string_from_wide2(buf, sz)
|
||||||
return _filename
|
return _filename
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user