2 * Win32 file change notification functions
4 * Copyright 1998 Ulrich Weigand
20 /* The change notification object */
27 /****************************************************************************
28 * FindFirstChangeNotification32A (KERNEL32.248)
30 HANDLE WINAPI
FindFirstChangeNotificationA( LPCSTR lpPathName
,
32 DWORD dwNotifyFilter
)
34 CHANGE_OBJECT
*change
;
35 struct create_change_notification_request req
;
36 struct create_change_notification_reply reply
;
38 req
.subtree
= bWatchSubtree
;
39 req
.filter
= dwNotifyFilter
;
40 CLIENT_SendRequest( REQ_CREATE_CHANGE_NOTIFICATION
, -1, 1, &req
, sizeof(req
) );
41 CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
);
42 if (reply
.handle
== -1) return INVALID_HANDLE_VALUE
;
44 change
= HeapAlloc( SystemHeap
, 0, sizeof(CHANGE_OBJECT
) );
47 CLIENT_CloseHandle( reply
.handle
);
48 return INVALID_HANDLE_VALUE
;
50 change
->header
.type
= K32OBJ_CHANGE
;
51 change
->header
.refcount
= 1;
52 return HANDLE_Alloc( PROCESS_Current(), &change
->header
,
53 STANDARD_RIGHTS_REQUIRED
|SYNCHRONIZE
/*FIXME*/,
54 FALSE
, reply
.handle
);
57 /****************************************************************************
58 * FindFirstChangeNotification32W (KERNEL32.249)
60 HANDLE WINAPI
FindFirstChangeNotificationW( LPCWSTR lpPathName
,
64 LPSTR nameA
= HEAP_strdupWtoA( GetProcessHeap(), 0, lpPathName
);
65 HANDLE ret
= FindFirstChangeNotificationA( nameA
, bWatchSubtree
,
67 if (nameA
) HeapFree( GetProcessHeap(), 0, nameA
);
71 /****************************************************************************
72 * FindNextChangeNotification (KERNEL32.252)
74 BOOL WINAPI
FindNextChangeNotification( HANDLE handle
)
76 if (HANDLE_GetServerHandle( PROCESS_Current(), handle
,
77 K32OBJ_FILE
, 0 ) == -1)
79 /* FIXME: do something */
83 /****************************************************************************
84 * FindCloseChangeNotification (KERNEL32.247)
86 BOOL WINAPI
FindCloseChangeNotification( HANDLE handle
)
88 return CloseHandle( handle
);