Skip to content

Commit b11c5d8

Browse files
authoredJun 6, 2018
fix std.os.windows.PathFileExists specified in the wrong DLL (#1066)
closes #1054
·
0.15.20.3.0
1 parent 4fc6018 commit b11c5d8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
 

‎std/os/file.zig‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ pub const File = struct {
123123
}
124124
return true;
125125
} else if (is_windows) {
126-
if (os.windows.PathFileExists(path_with_null.ptr) == os.windows.TRUE) {
126+
// TODO do not depend on shlwapi.dll
127+
if (os.windows.PathFileExistsA(path_with_null.ptr) == os.windows.TRUE) {
127128
return true;
128129
}
129130

‎std/os/windows/index.zig‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ pub extern "kernel32" stdcallcc fn QueryPerformanceCounter(lpPerformanceCount: *
123123

124124
pub extern "kernel32" stdcallcc fn QueryPerformanceFrequency(lpFrequency: *LARGE_INTEGER) BOOL;
125125

126-
pub extern "kernel32" stdcallcc fn PathFileExists(pszPath: ?LPCTSTR) BOOL;
127-
128126
pub extern "kernel32" stdcallcc fn ReadFile(
129127
in_hFile: HANDLE,
130128
out_lpBuffer: *c_void,
@@ -163,6 +161,8 @@ pub extern "kernel32" stdcallcc fn FreeLibrary(hModule: HMODULE) BOOL;
163161

164162
pub extern "user32" stdcallcc fn MessageBoxA(hWnd: ?HANDLE, lpText: ?LPCTSTR, lpCaption: ?LPCTSTR, uType: UINT) c_int;
165163

164+
pub extern "shlwapi" stdcallcc fn PathFileExistsA(pszPath: ?LPCTSTR) BOOL;
165+
166166
pub const PROV_RSA_FULL = 1;
167167

168168
pub const BOOL = c_int;

0 commit comments

Comments
 (0)
Please sign in to comment.