2 * Win32 file change notification functions
4 * Copyright 1998 Ulrich Weigand
21 /* The change notification object */
28 /****************************************************************************
29 * FindFirstChangeNotification32A (KERNEL32.248)
31 HANDLE32 WINAPI
FindFirstChangeNotification32A( LPCSTR lpPathName
,
33 DWORD dwNotifyFilter
)
35 CHANGE_OBJECT
*change
;
36 struct create_change_notification_request req
;
37 struct create_change_notification_reply reply
;
39 req
.subtree
= bWatchSubtree
;
40 req
.filter
= dwNotifyFilter
;
41 CLIENT_SendRequest( REQ_CREATE_CHANGE_NOTIFICATION
, -1, 1, &req
, sizeof(req
) );
42 CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
);
43 if (reply
.handle
== -1) return INVALID_HANDLE_VALUE32
;
45 change
= HeapAlloc( SystemHeap
, 0, sizeof(CHANGE_OBJECT
) );
48 CLIENT_CloseHandle( reply
.handle
);
49 return INVALID_HANDLE_VALUE32
;
51 change
->header
.type
= K32OBJ_CHANGE
;
52 change
->header
.refcount
= 1;
53 return HANDLE_Alloc( PROCESS_Current(), &change
->header
,
54 STANDARD_RIGHTS_REQUIRED
|SYNCHRONIZE
/*FIXME*/,
55 FALSE
, reply
.handle
);
58 /****************************************************************************
59 * FindFirstChangeNotification32W (KERNEL32.249)
61 HANDLE32 WINAPI
FindFirstChangeNotification32W( LPCWSTR lpPathName
,
65 LPSTR nameA
= HEAP_strdupWtoA( GetProcessHeap(), 0, lpPathName
);
66 HANDLE32 ret
= FindFirstChangeNotification32A( nameA
, bWatchSubtree
,
68 if (nameA
) HeapFree( GetProcessHeap(), 0, nameA
);
72 /****************************************************************************
73 * FindNextChangeNotification (KERNEL32.252)
75 BOOL32 WINAPI
FindNextChangeNotification( HANDLE32 handle
)
77 if (HANDLE_GetServerHandle( PROCESS_Current(), handle
,
78 K32OBJ_FILE
, 0 ) == -1)
80 /* FIXME: do something */
84 /****************************************************************************
85 * FindCloseChangeNotification (KERNEL32.247)
87 BOOL32 WINAPI
FindCloseChangeNotification( HANDLE32 handle
)
89 return CloseHandle( handle
);