equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
231 WIN32_FIND_DATAW wfd; |
231 WIN32_FIND_DATAW wfd; |
232 HANDLE h; |
232 HANDLE h; |
233 |
233 |
234 if (GetFileAttributesExW(path, GetFileExInfoStandard, &wfad)) { |
234 if (GetFileAttributesExW(path, GetFileExInfoStandard, &wfad)) { |
235 attr = getFinalAttributesIfReparsePoint(path, wfad.dwFileAttributes); |
235 attr = getFinalAttributesIfReparsePoint(path, wfad.dwFileAttributes); |
236 } else if (GetLastError() == ERROR_SHARING_VIOLATION && |
236 } else { |
237 (h = FindFirstFileW(path, &wfd)) != INVALID_HANDLE_VALUE) { |
237 DWORD lerr = GetLastError(); |
238 attr = getFinalAttributesIfReparsePoint(path, wfd.dwFileAttributes); |
238 if ((lerr == ERROR_SHARING_VIOLATION || lerr == ERROR_ACCESS_DENIED) && |
239 FindClose(h); |
239 (h = FindFirstFileW(path, &wfd)) != INVALID_HANDLE_VALUE) { |
|
240 attr = getFinalAttributesIfReparsePoint(path, wfd.dwFileAttributes); |
|
241 FindClose(h); |
|
242 } |
240 } |
243 } |
241 return attr; |
244 return attr; |
242 } |
245 } |
243 |
246 |
244 JNIEXPORT jstring JNICALL |
247 JNIEXPORT jstring JNICALL |