Add support for specific EOI PIC command.
[wine] / dlls / kernel / change.c
1 /*
2  * Win32 file change notification functions
3  *
4  * Copyright 1998 Ulrich Weigand
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "config.h"
22
23 #include <stdlib.h>
24 #include <string.h>
25
26 #include "winbase.h"
27 #include "winerror.h"
28 #include "wine/windef16.h"
29 #include "wine/server.h"
30 #include "wine/debug.h"
31
32 WINE_DEFAULT_DEBUG_CHANNEL(file);
33
34 /****************************************************************************
35  *              FindFirstChangeNotificationA (KERNEL32.@)
36  */
37 HANDLE WINAPI FindFirstChangeNotificationA( LPCSTR lpPathName, BOOL bWatchSubtree,
38                                             DWORD dwNotifyFilter )
39 {
40     HANDLE file, ret = INVALID_HANDLE_VALUE;
41
42     TRACE( "%s %d %lx\n", debugstr_a(lpPathName), bWatchSubtree, dwNotifyFilter );
43
44     if ((file = CreateFileA( lpPathName, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
45                              OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0 )) == INVALID_HANDLE_VALUE)
46         return INVALID_HANDLE_VALUE;
47
48     SERVER_START_REQ( create_change_notification )
49     {
50         req->handle  = file;
51         req->subtree = bWatchSubtree;
52         req->filter  = dwNotifyFilter;
53         if (!wine_server_call_err( req )) ret = reply->handle;
54     }
55     SERVER_END_REQ;
56     CloseHandle( file );
57     return ret;
58 }
59
60 /****************************************************************************
61  *              FindFirstChangeNotificationW (KERNEL32.@)
62  */
63 HANDLE WINAPI FindFirstChangeNotificationW( LPCWSTR lpPathName, BOOL bWatchSubtree,
64                                             DWORD dwNotifyFilter)
65 {
66     HANDLE file, ret = INVALID_HANDLE_VALUE;
67
68     TRACE( "%s %d %lx\n", debugstr_w(lpPathName), bWatchSubtree, dwNotifyFilter );
69
70     if ((file = CreateFileW( lpPathName, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
71                              OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0 )) == INVALID_HANDLE_VALUE)
72         return INVALID_HANDLE_VALUE;
73
74     SERVER_START_REQ( create_change_notification )
75     {
76         req->handle  = file;
77         req->subtree = bWatchSubtree;
78         req->filter  = dwNotifyFilter;
79         if (!wine_server_call_err( req )) ret = reply->handle;
80     }
81     SERVER_END_REQ;
82     CloseHandle( file );
83     return ret;
84 }
85
86 /****************************************************************************
87  *              FindNextChangeNotification (KERNEL32.@)
88  */
89 BOOL WINAPI FindNextChangeNotification( HANDLE handle )
90 {
91     BOOL ret;
92
93     TRACE("%p\n",handle);
94
95     SERVER_START_REQ( next_change_notification )
96     {
97         req->handle = handle;
98         ret = !wine_server_call_err( req );
99     }
100     SERVER_END_REQ;
101     return ret;
102 }
103
104 /****************************************************************************
105  *              FindCloseChangeNotification (KERNEL32.@)
106  */
107 BOOL WINAPI FindCloseChangeNotification( HANDLE handle )
108 {
109     return CloseHandle( handle );
110 }
111
112 /***********************************************************************
113 *       FileCDR (KERNEL.130)
114 */
115 FARPROC16 WINAPI FileCDR16(FARPROC16 x)
116 {
117     FIXME("(0x%8x): stub\n", (int) x);
118     return (FARPROC16)TRUE;
119 }