2 * Win32 file change notification functions
4 * Copyright 1998 Ulrich Weigand
20 /* The change notification object */
27 /****************************************************************************
28 * FindFirstChangeNotification32A (KERNEL32.248)
30 HANDLE32 WINAPI FindFirstChangeNotification32A( 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_VALUE32;
44 change = HeapAlloc( SystemHeap, 0, sizeof(CHANGE_OBJECT) );
47 CLIENT_CloseHandle( reply.handle );
48 return INVALID_HANDLE_VALUE32;
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 HANDLE32 WINAPI FindFirstChangeNotification32W( LPCWSTR lpPathName,
64 LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpPathName );
65 HANDLE32 ret = FindFirstChangeNotification32A( nameA, bWatchSubtree,
67 if (nameA) HeapFree( GetProcessHeap(), 0, nameA );
71 /****************************************************************************
72 * FindNextChangeNotification (KERNEL32.252)
74 BOOL32 WINAPI FindNextChangeNotification( HANDLE32 handle )
76 if (HANDLE_GetServerHandle( PROCESS_Current(), handle,
77 K32OBJ_FILE, 0 ) == -1)
79 /* FIXME: do something */
83 /****************************************************************************
84 * FindCloseChangeNotification (KERNEL32.247)
86 BOOL32 WINAPI FindCloseChangeNotification( HANDLE32 handle)
88 return CloseHandle( handle );