No longer directly accessing debuggee memory.
[wine] / files / change.c
1 /*
2  * Win32 file change notification functions
3  *
4  * Copyright 1998 Ulrich Weigand
5  */
6
7 #include <assert.h>
8 #include <stdlib.h>
9 #include <unistd.h>
10 #include <string.h>
11 #include <time.h>
12 #include "winbase.h"
13 #include "winerror.h"
14 #include "process.h"
15 #include "thread.h"
16 #include "heap.h"
17 #include "server.h"
18 #include "debugtools.h"
19
20
21 /****************************************************************************
22  *              FindFirstChangeNotificationA (KERNEL32.248)
23  */
24 HANDLE WINAPI FindFirstChangeNotificationA( LPCSTR lpPathName, BOOL bWatchSubtree,
25                                             DWORD dwNotifyFilter ) 
26 {
27     struct create_change_notification_request *req = get_req_buffer();
28
29     req->subtree = bWatchSubtree;
30     req->filter  = dwNotifyFilter;
31     server_call( REQ_CREATE_CHANGE_NOTIFICATION );
32     return req->handle;
33 }
34
35 /****************************************************************************
36  *              FindFirstChangeNotification32W (KERNEL32.249)
37  */
38 HANDLE WINAPI FindFirstChangeNotificationW( LPCWSTR lpPathName,
39                                                 BOOL bWatchSubtree,
40                                                 DWORD dwNotifyFilter) 
41 {
42     LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, lpPathName );
43     HANDLE ret = FindFirstChangeNotificationA( nameA, bWatchSubtree, 
44                                                           dwNotifyFilter );
45     if (nameA) HeapFree( GetProcessHeap(), 0, nameA );
46     return ret;
47 }
48
49 /****************************************************************************
50  *              FindNextChangeNotification (KERNEL32.252)
51  */
52 BOOL WINAPI FindNextChangeNotification( HANDLE handle ) 
53 {
54     /* FIXME: do something */
55     return TRUE;
56 }
57
58 /****************************************************************************
59  *              FindCloseChangeNotification (KERNEL32.247)
60  */
61 BOOL WINAPI FindCloseChangeNotification( HANDLE handle) 
62 {
63     return CloseHandle( handle );
64 }
65