/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef _WIN32_WINNT
#endif
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <direct.h>
#include <malloc.h>
#include <io.h>
#include <windows.h>
#include <aclapi.h>
#include <winioctl.h>
#include <Sddl.h>
#include "jni.h"
#include "jni_util.h"
#include "jlong.h"
#include "sun_nio_fs_WindowsNativeDispatcher.h"
/**
* jfieldIDs
*/
/**
* Win32 APIs not available in Windows XP
*/
"(I)V", lastError);
if (x != NULL) {
}
}
/**
* Initializes jfieldIDs and get address of Win32 calls that are located
* at runtime.
*/
{
HMODULE h;
return;
}
return;
}
return;
}
return;
}
return;
}
return;
}
return;
}
return;
}
// get handle to kernel32
(LPCWSTR)&CreateFileW, &h) != 0)
{
// requires Windows Server 2003 or newer
// requires Windows Vista or newer
}
}
NULL,
0,
&message[0],
255,
NULL);
if (len == 0) {
return NULL;
} else {
}
}
{
}
{
if (lpSecurityDescriptor == NULL) {
} else {
}
NULL);
if (handle == INVALID_HANDLE_VALUE) {
}
return ptr_to_jlong(handle);
}
{
}
}
{
&bytesReturned, NULL) == 0)
{
}
}
{
if (DeleteFileW(lpFileName) == 0) {
}
}
{
if (lpSecurityDescriptor == NULL) {
} else {
}
}
}
{
if (RemoveDirectoryW(lpFileName) == 0) {
}
}
{
CloseHandle(h);
}
{
if (handle != INVALID_HANDLE_VALUE) {
return;
} else {
}
}
{
if (handle == INVALID_HANDLE_VALUE) {
}
return ptr_to_jlong(handle);
}
{
if (FindNextFileW(h, data) != 0) {
} else {
if (GetLastError() != ERROR_NO_MORE_FILES)
return NULL;
}
}
{
if (FindFirstStream_func == NULL) {
return;
}
if (handle != INVALID_HANDLE_VALUE) {
return;
} else {
if (GetLastError() == ERROR_HANDLE_EOF) {
} else {
}
}
}
{
if (FindNextStream_func == NULL) {
return NULL;
}
if ((*FindNextStream_func)(h, &data) != 0) {
} else {
if (GetLastError() != ERROR_HANDLE_EOF)
return NULL;
}
}
{
if (FindClose(h) == 0) {
}
}
{
if (GetFileInformationByHandle(h, info) == 0) {
}
}
{
{
}
}
{
}
}
{
if (res == 0) {
}
}
{
if (value == INVALID_FILE_ATTRIBUTES) {
}
}
{
}
}
{
if (res == 0)
}
{
if (SetFileTime(h,
{
}
}
{
if (SetEndOfFile(h) == 0)
}
{
&volumeName[0],
MAX_PATH+1,
&flags,
&fileSystemName[0],
MAX_PATH+1);
if (res == 0) {
return;
}
}
}
{
if (res == 0) {
return;
}
}
{
&volumeName[0],
MAX_PATH+1);
if (res == 0) {
return NULL;
} else {
}
}
{
}
}
{
}
}
{
if (res == 0) {
}
}
{
&lengthNeeded);
if (res == 0) {
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
return (jint)lengthNeeded;
} else {
return 0;
}
} else {
}
}
{
}
return ptr_to_jlong(pOwner);
}
{
}
}
{
return (jlong)0;
} else {
}
}
{
}
}
{
if (GetAclInformation(pAcl, (void *) &acl_size_info, sizeof(acl_size_info), AclSizeInformation) == 0) {
} else {
}
}
{
return (jlong)0;
} else {
return ptr_to_jlong(pAce);
}
}
{
}
}
{
}
}
{
jstring s;
return;
}
if (s == NULL)
return;
if (s == NULL)
return;
}
{
{
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
}
}
return cbSid;
}
{
}
{
return NULL;
} else {
return s;
}
}
{
return ptr_to_jlong(pSid);
}
return ptr_to_jlong(hProcess);
}
return ptr_to_jlong(hThread);
}
{
return ptr_to_jlong(hToken);
}
{
if (GetLastError() == ERROR_NO_TOKEN)
return (jlong)0;
}
return ptr_to_jlong(hToken);
}
{
NULL,
&resultToken);
if (res == 0)
return ptr_to_jlong(resultToken);
}
{
}
{
if (res == 0) {
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
return (jint)lengthNeeded;
} else {
return 0;
}
} else {
return tokenInfoLength;
}
}
{
}
{
/* checkAccessRights is in-out parameter */
}
{
} else {
}
return ptr_to_jlong(pLuid);
}
{
if (CreateSymbolicLink_func == NULL) {
return;
}
/* On Windows 64-bit this appears to succeed even when there is insufficient privileges */
}
{
}
{
if (len > 0) {
} else {
if (len > 0) {
} else {
}
}
}
}
if (len == 0)
return rv;
}
{
if (GetFinalPathNameByHandle_func == NULL) {
return NULL;
}
if (len > 0) {
} else {
if (len > 0) {
} else {
}
}
}
}
if (len == 0)
return rv;
}
{
ck,
0);
}
return ptr_to_jlong(port);
}
{
INFINITE);
} else {
}
}
{
(DWORD)0, /* dwNumberOfBytesTransferred */
NULL); /* lpOverlapped */
if (res == 0) {
}
}
{
NULL);
if (res == 0) {
}
}
{
a,
&pContext);
if (res == 0) {
} else {
}
}
{
&pContext);
if (res == 0) {
}
}