jdk/src/java.base/windows/native/libjava/WinNTFileSystem_md.c
changeset 45175 4468d97d77fc
parent 42777 a94fc33e9866
equal deleted inserted replaced
45093:c42dc7b58b4d 45175:4468d97d77fc
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2017, 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
   470 JNIEXPORT jlong JNICALL
   470 JNIEXPORT jlong JNICALL
   471 Java_java_io_WinNTFileSystem_getLastModifiedTime(JNIEnv *env, jobject this,
   471 Java_java_io_WinNTFileSystem_getLastModifiedTime(JNIEnv *env, jobject this,
   472                                                  jobject file)
   472                                                  jobject file)
   473 {
   473 {
   474     jlong rv = 0;
   474     jlong rv = 0;
   475     LARGE_INTEGER modTime;
   475     ULARGE_INTEGER modTime;
   476     FILETIME t;
   476     FILETIME t;
   477     HANDLE h;
   477     HANDLE h;
   478     WCHAR *pathbuf = fileToNTPath(env, file, ids.path);
   478     WCHAR *pathbuf = fileToNTPath(env, file, ids.path);
   479     if (pathbuf == NULL)
   479     if (pathbuf == NULL)
   480         return rv;
   480         return rv;
   782                     NULL,
   782                     NULL,
   783                     OPEN_EXISTING,
   783                     OPEN_EXISTING,
   784                     FILE_FLAG_BACKUP_SEMANTICS,
   784                     FILE_FLAG_BACKUP_SEMANTICS,
   785                     0);
   785                     0);
   786     if (h != INVALID_HANDLE_VALUE) {
   786     if (h != INVALID_HANDLE_VALUE) {
   787         LARGE_INTEGER modTime;
   787         ULARGE_INTEGER modTime;
   788         FILETIME t;
   788         FILETIME t;
   789         modTime.QuadPart = (time + 11644473600000L) * 10000L;
   789         modTime.QuadPart = (time + 11644473600000L) * 10000L;
   790         t.dwLowDateTime = (DWORD)modTime.LowPart;
   790         t.dwLowDateTime = (DWORD)modTime.LowPart;
   791         t.dwHighDateTime = (DWORD)modTime.HighPart;
   791         t.dwHighDateTime = (DWORD)modTime.HighPart;
   792         if (SetFileTime(h, NULL, NULL, &t)) {
   792         if (SetFileTime(h, NULL, NULL, &t)) {