Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Win32 file change notification functions |
| 3 | * |
| 4 | * Copyright 1998 Ulrich Weigand |
| 5 | */ |
| 6 | |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 7 | #include <assert.h> |
| 8 | #include <stdlib.h> |
| 9 | #include <unistd.h> |
| 10 | #include <string.h> |
| 11 | #include <time.h> |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 12 | #include "winbase.h" |
| 13 | #include "winerror.h" |
| 14 | #include "process.h" |
| 15 | #include "thread.h" |
| 16 | #include "heap.h" |
Alexandre Julliard | 5544387 | 1998-12-31 15:52:06 +0000 | [diff] [blame] | 17 | #include "server.h" |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 18 | #include "debug.h" |
| 19 | |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 20 | |
| 21 | /**************************************************************************** |
| 22 | * FindFirstChangeNotification32A (KERNEL32.248) |
| 23 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 24 | HANDLE WINAPI FindFirstChangeNotificationA( LPCSTR lpPathName, |
| 25 | BOOL bWatchSubtree, |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 26 | DWORD dwNotifyFilter ) |
| 27 | { |
Alexandre Julliard | 5544387 | 1998-12-31 15:52:06 +0000 | [diff] [blame] | 28 | struct create_change_notification_request req; |
| 29 | struct create_change_notification_reply reply; |
Alexandre Julliard | 5544387 | 1998-12-31 15:52:06 +0000 | [diff] [blame] | 30 | |
| 31 | req.subtree = bWatchSubtree; |
| 32 | req.filter = dwNotifyFilter; |
| 33 | CLIENT_SendRequest( REQ_CREATE_CHANGE_NOTIFICATION, -1, 1, &req, sizeof(req) ); |
Alexandre Julliard | 6ebbe3c | 1999-01-01 17:04:00 +0000 | [diff] [blame] | 34 | CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL ); |
Alexandre Julliard | 96c08d8 | 1999-02-28 13:27:56 +0000 | [diff] [blame] | 35 | return reply.handle; |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | /**************************************************************************** |
| 39 | * FindFirstChangeNotification32W (KERNEL32.249) |
| 40 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 41 | HANDLE WINAPI FindFirstChangeNotificationW( LPCWSTR lpPathName, |
| 42 | BOOL bWatchSubtree, |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 43 | DWORD dwNotifyFilter) |
| 44 | { |
| 45 | LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpPathName ); |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 46 | HANDLE ret = FindFirstChangeNotificationA( nameA, bWatchSubtree, |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 47 | dwNotifyFilter ); |
| 48 | if (nameA) HeapFree( GetProcessHeap(), 0, nameA ); |
| 49 | return ret; |
| 50 | } |
| 51 | |
| 52 | /**************************************************************************** |
| 53 | * FindNextChangeNotification (KERNEL32.252) |
| 54 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 55 | BOOL WINAPI FindNextChangeNotification( HANDLE handle ) |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 56 | { |
Alexandre Julliard | 62a8b43 | 1999-01-19 17:48:23 +0000 | [diff] [blame] | 57 | /* FIXME: do something */ |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 58 | return TRUE; |
| 59 | } |
| 60 | |
| 61 | /**************************************************************************** |
| 62 | * FindCloseChangeNotification (KERNEL32.247) |
| 63 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 64 | BOOL WINAPI FindCloseChangeNotification( HANDLE handle) |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 65 | { |
| 66 | return CloseHandle( handle ); |
| 67 | } |
| 68 | |