blob: 4142d39b0eec544a2d4e3c46e8d622acda64eb46 [file] [log] [blame]
Alexandre Julliard767e6f61998-08-09 12:47:43 +00001/*
2 * Win32 file change notification functions
3 *
4 * Copyright 1998 Ulrich Weigand
5 */
6
Alexandre Julliard767e6f61998-08-09 12:47:43 +00007#include <assert.h>
8#include <stdlib.h>
9#include <unistd.h>
10#include <string.h>
11#include <time.h>
Alexandre Julliard767e6f61998-08-09 12:47:43 +000012#include "winbase.h"
13#include "winerror.h"
14#include "process.h"
15#include "thread.h"
16#include "heap.h"
Alexandre Julliard55443871998-12-31 15:52:06 +000017#include "server.h"
Alexandre Julliard767e6f61998-08-09 12:47:43 +000018#include "debug.h"
19
Alexandre Julliard767e6f61998-08-09 12:47:43 +000020
21/****************************************************************************
22 * FindFirstChangeNotification32A (KERNEL32.248)
23 */
Alexandre Julliarda3960291999-02-26 11:11:13 +000024HANDLE WINAPI FindFirstChangeNotificationA( LPCSTR lpPathName,
25 BOOL bWatchSubtree,
Alexandre Julliard767e6f61998-08-09 12:47:43 +000026 DWORD dwNotifyFilter )
27{
Alexandre Julliard55443871998-12-31 15:52:06 +000028 struct create_change_notification_request req;
29 struct create_change_notification_reply reply;
Alexandre Julliard55443871998-12-31 15:52:06 +000030
31 req.subtree = bWatchSubtree;
32 req.filter = dwNotifyFilter;
33 CLIENT_SendRequest( REQ_CREATE_CHANGE_NOTIFICATION, -1, 1, &req, sizeof(req) );
Alexandre Julliard6ebbe3c1999-01-01 17:04:00 +000034 CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL );
Alexandre Julliard96c08d81999-02-28 13:27:56 +000035 return reply.handle;
Alexandre Julliard767e6f61998-08-09 12:47:43 +000036}
37
38/****************************************************************************
39 * FindFirstChangeNotification32W (KERNEL32.249)
40 */
Alexandre Julliarda3960291999-02-26 11:11:13 +000041HANDLE WINAPI FindFirstChangeNotificationW( LPCWSTR lpPathName,
42 BOOL bWatchSubtree,
Alexandre Julliard767e6f61998-08-09 12:47:43 +000043 DWORD dwNotifyFilter)
44{
45 LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpPathName );
Alexandre Julliarda3960291999-02-26 11:11:13 +000046 HANDLE ret = FindFirstChangeNotificationA( nameA, bWatchSubtree,
Alexandre Julliard767e6f61998-08-09 12:47:43 +000047 dwNotifyFilter );
48 if (nameA) HeapFree( GetProcessHeap(), 0, nameA );
49 return ret;
50}
51
52/****************************************************************************
53 * FindNextChangeNotification (KERNEL32.252)
54 */
Alexandre Julliarda3960291999-02-26 11:11:13 +000055BOOL WINAPI FindNextChangeNotification( HANDLE handle )
Alexandre Julliard767e6f61998-08-09 12:47:43 +000056{
Alexandre Julliard62a8b431999-01-19 17:48:23 +000057 /* FIXME: do something */
Alexandre Julliard767e6f61998-08-09 12:47:43 +000058 return TRUE;
59}
60
61/****************************************************************************
62 * FindCloseChangeNotification (KERNEL32.247)
63 */
Alexandre Julliarda3960291999-02-26 11:11:13 +000064BOOL WINAPI FindCloseChangeNotification( HANDLE handle)
Alexandre Julliard767e6f61998-08-09 12:47:43 +000065{
66 return CloseHandle( handle );
67}
68