1 11 package org.eclipse.core.internal.resources.refresh.win32; 12 13 14 17 public class Win32Natives { 18 19 23 public static final long INVALID_HANDLE_VALUE; 24 28 public static final int ERROR_SUCCESS; 29 33 public static final int ERROR_INVALID_HANDLE; 34 37 public static int FILE_NOTIFY_ALL; 38 42 public static final int MAXIMUM_WAIT_OBJECTS; 43 46 public static final int MAX_PATH; 47 50 public static final int INFINITE; 51 52 53 56 public static final int WAIT_TIMEOUT; 57 61 public static final int WAIT_OBJECT_0; 62 66 public static final int WAIT_FAILED; 67 68 69 72 public static final int FILE_NOTIFY_CHANGE_FILE_NAME; 73 76 public static final int FILE_NOTIFY_CHANGE_DIR_NAME; 77 80 public static final int FILE_NOTIFY_CHANGE_ATTRIBUTES; 81 84 public static final int FILE_NOTIFY_CHANGE_SIZE; 85 88 public static final int FILE_NOTIFY_CHANGE_LAST_WRITE; 89 93 public static final int FILE_NOTIFY_CHANGE_SECURITY; 94 95 98 public static final boolean UNICODE; 99 102 static { 103 System.loadLibrary("win32refresh"); UNICODE= IsUnicode(); 105 INVALID_HANDLE_VALUE= INVALID_HANDLE_VALUE(); 106 ERROR_SUCCESS= ERROR_SUCCESS(); 107 ERROR_INVALID_HANDLE= ERROR_INVALID_HANDLE(); 108 109 MAXIMUM_WAIT_OBJECTS= MAXIMUM_WAIT_OBJECTS(); 110 MAX_PATH= MAX_PATH(); 111 INFINITE= INFINITE(); 112 113 WAIT_TIMEOUT= WAIT_TIMEOUT(); 114 WAIT_OBJECT_0= WAIT_OBJECT_0(); 115 WAIT_FAILED= WAIT_FAILED(); 116 117 FILE_NOTIFY_CHANGE_FILE_NAME= FILE_NOTIFY_CHANGE_FILE_NAME(); 118 FILE_NOTIFY_CHANGE_DIR_NAME= FILE_NOTIFY_CHANGE_DIR_NAME(); 119 FILE_NOTIFY_CHANGE_ATTRIBUTES= FILE_NOTIFY_CHANGE_ATTRIBUTES(); 120 FILE_NOTIFY_CHANGE_SIZE= FILE_NOTIFY_CHANGE_SIZE(); 121 FILE_NOTIFY_CHANGE_LAST_WRITE= FILE_NOTIFY_CHANGE_LAST_WRITE(); 122 FILE_NOTIFY_CHANGE_SECURITY= FILE_NOTIFY_CHANGE_SECURITY(); 123 FILE_NOTIFY_ALL= 124 FILE_NOTIFY_CHANGE_FILE_NAME | 125 FILE_NOTIFY_CHANGE_DIR_NAME | 126 FILE_NOTIFY_CHANGE_ATTRIBUTES | 127 FILE_NOTIFY_CHANGE_SIZE | 128 FILE_NOTIFY_CHANGE_LAST_WRITE | 129 FILE_NOTIFY_CHANGE_SECURITY; 130 } 131 132 153 public static long FindFirstChangeNotification(String lpPathName, boolean bWatchSubtree, int dwNotifyFilter) { 154 if (UNICODE) 155 return FindFirstChangeNotificationW(lpPathName, bWatchSubtree, dwNotifyFilter); 156 return FindFirstChangeNotificationA(Convert.toPlatformBytes(lpPathName), bWatchSubtree, dwNotifyFilter); 157 } 158 176 private static native long FindFirstChangeNotificationW(String lpPathName, boolean bWatchSubtree, int dwNotifyFilter); 177 178 197 private static native long FindFirstChangeNotificationA(byte[] lpPathName, boolean bWatchSubtree, int dwNotifyFilter); 198 199 200 209 public static native boolean FindCloseChangeNotification(long hChangeHandle); 210 211 219 public static native boolean FindNextChangeNotification(long hChangeHandle); 220 221 241 public static native int WaitForMultipleObjects(int nCount, long[] lpHandles, boolean bWaitAll, int dwMilliseconds); 242 243 249 private static native boolean IsUnicode(); 250 251 255 public static native int GetLastError(); 256 257 261 private static native int FILE_NOTIFY_CHANGE_LAST_WRITE(); 262 263 267 private static native int FILE_NOTIFY_CHANGE_DIR_NAME(); 268 269 273 private static native int FILE_NOTIFY_CHANGE_ATTRIBUTES(); 274 275 279 private static native int FILE_NOTIFY_CHANGE_SIZE(); 280 281 285 private static native int FILE_NOTIFY_CHANGE_FILE_NAME(); 286 287 291 private static native int FILE_NOTIFY_CHANGE_SECURITY(); 292 293 297 private static native int MAXIMUM_WAIT_OBJECTS(); 298 299 303 private static native int MAX_PATH(); 304 305 309 private static native int INFINITE(); 310 311 315 private static native int WAIT_OBJECT_0(); 316 317 321 private static native int WAIT_FAILED(); 322 323 327 private static native int WAIT_TIMEOUT(); 328 329 333 private static native int ERROR_INVALID_HANDLE(); 334 335 339 private static native int ERROR_SUCCESS(); 340 341 345 private static native long INVALID_HANDLE_VALUE(); 346 347 } 348 | Popular Tags |