|
@@ -46,15 +46,15 @@ full_path_from_name :: proc(name: string, allocator: runtime.Allocator) -> (path
|
|
if name == "" {
|
|
if name == "" {
|
|
name = "."
|
|
name = "."
|
|
}
|
|
}
|
|
- _TEMP_ALLOCATOR_GUARD()
|
|
|
|
|
|
+ TEMP_ALLOCATOR_GUARD()
|
|
|
|
|
|
- p := win32.utf8_to_utf16(name, _temp_allocator())
|
|
|
|
|
|
+ p := win32.utf8_to_utf16(name, temp_allocator())
|
|
|
|
|
|
n := win32.GetFullPathNameW(raw_data(p), 0, nil, nil)
|
|
n := win32.GetFullPathNameW(raw_data(p), 0, nil, nil)
|
|
if n == 0 {
|
|
if n == 0 {
|
|
return "", _get_platform_error()
|
|
return "", _get_platform_error()
|
|
}
|
|
}
|
|
- buf := make([]u16, n+1, _temp_allocator())
|
|
|
|
|
|
+ buf := make([]u16, n+1, temp_allocator())
|
|
n = win32.GetFullPathNameW(raw_data(p), u32(len(buf)), raw_data(buf), nil)
|
|
n = win32.GetFullPathNameW(raw_data(p), u32(len(buf)), raw_data(buf), nil)
|
|
if n == 0 {
|
|
if n == 0 {
|
|
return "", _get_platform_error()
|
|
return "", _get_platform_error()
|
|
@@ -131,8 +131,8 @@ _cleanpath_from_handle :: proc(f: ^File, allocator: runtime.Allocator) -> (strin
|
|
if n == 0 {
|
|
if n == 0 {
|
|
return "", _get_platform_error()
|
|
return "", _get_platform_error()
|
|
}
|
|
}
|
|
- _TEMP_ALLOCATOR_GUARD()
|
|
|
|
- buf := make([]u16, max(n, 260)+1, _temp_allocator())
|
|
|
|
|
|
+ TEMP_ALLOCATOR_GUARD()
|
|
|
|
+ buf := make([]u16, max(n, 260)+1, temp_allocator())
|
|
n = win32.GetFinalPathNameByHandleW(h, raw_data(buf), u32(len(buf)), 0)
|
|
n = win32.GetFinalPathNameByHandleW(h, raw_data(buf), u32(len(buf)), 0)
|
|
return _cleanpath_from_buf(buf[:n], allocator)
|
|
return _cleanpath_from_buf(buf[:n], allocator)
|
|
}
|
|
}
|
|
@@ -147,8 +147,8 @@ _cleanpath_from_handle_u16 :: proc(f: ^File) -> ([]u16, Error) {
|
|
if n == 0 {
|
|
if n == 0 {
|
|
return nil, _get_platform_error()
|
|
return nil, _get_platform_error()
|
|
}
|
|
}
|
|
- _TEMP_ALLOCATOR_GUARD()
|
|
|
|
- buf := make([]u16, max(n, 260)+1, _temp_allocator())
|
|
|
|
|
|
+ TEMP_ALLOCATOR_GUARD()
|
|
|
|
+ buf := make([]u16, max(n, 260)+1, temp_allocator())
|
|
n = win32.GetFinalPathNameByHandleW(h, raw_data(buf), u32(len(buf)), 0)
|
|
n = win32.GetFinalPathNameByHandleW(h, raw_data(buf), u32(len(buf)), 0)
|
|
return _cleanpath_strip_prefix(buf[:n]), nil
|
|
return _cleanpath_strip_prefix(buf[:n]), nil
|
|
}
|
|
}
|