Ejemplo n.º 1
0
int DOKAN_CALLBACK OnSetFileTime(
	LPCWSTR		FileName,
	CONST FILETIME* CreationTime,
	CONST FILETIME* LastAccessTime,
	CONST FILETIME* LastWriteTime,
	PDOKAN_FILE_INFO DokanFileInfo ) {
	LOG( L"[OnSetFileTime] FileName = %s\n", FileName );
	JNIEnv* env = get_env();
	//jvm->AttachCurrentThread((void **)&env, NULL);

	int result = -ERROR_GEN_FAILURE;
	try {
		jstring jfileName = ToJavaString( env, FileName );
		jobject jdokanFileInfo = ToDokanFileInfoJavaObject( env, DokanFileInfo );

		env->CallVoidMethod( gOperations, onSetFileTimeID,
									jfileName, FileTime2LongLong( CreationTime ),
									FileTime2LongLong( LastAccessTime ), FileTime2LongLong( LastWriteTime ),
									jdokanFileInfo );
		result = GetOperationResult( env );
	} catch ( const char* msg ) {
		LOGA( "[OnSetFileTime] %s\n", msg );
	}

	release_env( env );
	return result;
}
Ejemplo n.º 2
0
LONGLONG GetProcessCPUTime( HANDLE hProcess ) {
 FILETIME creationTime, exitTime, kernelTime, userTime;
 if ( !GetProcessTimes( hProcess, &creationTime, &exitTime, &kernelTime, &userTime )) ExitProcess( GetLastError());
 return FileTime2LongLong( kernelTime ) + FileTime2LongLong( userTime );
}