mirror of
https://github.com/reactos/reactos.git
synced 2025-04-30 19:19:00 +00:00

* lib/kernel32/debug/break.c: Add @implemented and @unimplemented to APIs. * lib/kernel32/debug/debugger.c: Ditto. * lib/kernel32/debug/output.c: Ditto. * lib/kernel32/except/except.c: Ditto. * lib/kernel32/file/backup.c: Ditto. * lib/kernel32/file/cnotify.c: Ditto. * lib/kernel32/file/copy.c: Ditto. * lib/kernel32/file/create.c: Ditto. * lib/kernel32/file/curdir.c: Ditto. * lib/kernel32/file/delete.c: Ditto. * lib/kernel32/file/deviceio.c: Ditto. * lib/kernel32/file/dir.c: Ditto. * lib/kernel32/file/dosdev.c: Ditto. * lib/kernel32/file/file.c: Ditto. * lib/kernel32/file/find.c: Ditto. * lib/kernel32/file/iocompl.c: Ditto. * lib/kernel32/file/lfile.c: Ditto. * lib/kernel32/file/lock.c: Ditto. * lib/kernel32/file/mailslot.c: Ditto. * lib/kernel32/file/move.c: Ditto. * lib/kernel32/file/npipe.c: Ditto. * lib/kernel32/file/pipe.c: Ditto. * lib/kernel32/file/rw.c: Ditto. * lib/kernel32/file/tape.c: Ditto. * lib/kernel32/file/volume.c: Ditto. * lib/kernel32/mem/global.c: Ditto. * lib/kernel32/mem/heap.c: Ditto. * lib/kernel32/mem/isbad.c: Ditto. * lib/kernel32/mem/local.c: Ditto. * lib/kernel32/mem/procmem.c: Ditto. * lib/kernel32/mem/section.c: Ditto. * lib/kernel32/mem/virtual.c: Ditto. * lib/kernel32/misc/atom.c: Ditto. * lib/kernel32/misc/comm.c: Ditto. * lib/kernel32/misc/computername.c: Ditto. * lib/kernel32/misc/console.c: Ditto. * lib/kernel32/misc/env.c: Ditto. * lib/kernel32/misc/error.c: Ditto. * lib/kernel32/misc/errormsg.c: Ditto. * lib/kernel32/misc/handle.c: Ditto. * lib/kernel32/misc/ldr.c: Ditto. * lib/kernel32/misc/mbchars.c: Ditto. * lib/kernel32/misc/muldiv.c: Ditto. * lib/kernel32/misc/perfcnt.c: Ditto. * lib/kernel32/misc/profile.c: Ditto. * lib/kernel32/misc/res.c: Ditto. * lib/kernel32/misc/stubs.c: Ditto. * lib/kernel32/misc/sysinfo.c: Ditto. * lib/kernel32/misc/time.c: Ditto. * lib/kernel32/misc/toolhelp.c: Ditto. * lib/kernel32/process/cmdline.c: Ditto. * lib/kernel32/process/create.c: Ditto. * lib/kernel32/process/proc.c: Ditto. * lib/kernel32/process/session.c: Ditto. * lib/kernel32/string/lstring.c: Ditto. * lib/kernel32/synch/critical.c: Ditto. * lib/kernel32/synch/event.c: Ditto. * lib/kernel32/synch/intrlck.c: Ditto. * lib/kernel32/synch/mutex.c: Ditto. * lib/kernel32/synch/sem.c: Ditto. * lib/kernel32/synch/timer.c: Ditto. * lib/kernel32/synch/wait.c: Ditto. * lib/kernel32/thread/fiber.c: Ditto. * lib/kernel32/thread/fls.c: Ditto. * lib/kernel32/thread/thread.c: Ditto. * lib/kernel32/thread/tls.c: Ditto. svn path=/trunk/; revision=5045
172 lines
4.3 KiB
C
172 lines
4.3 KiB
C
/* $Id: cnotify.c,v 1.7 2003/07/10 18:50:51 chorns Exp $
|
|
*
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
* PROJECT: ReactOS system libraries
|
|
* FILE: lib/kernel32/file/find.c
|
|
* PURPOSE: Find functions
|
|
* PROGRAMMER: Ariadne ( ariadne@xs4all.nl)
|
|
* UPDATE HISTORY:
|
|
* Created 01/11/98
|
|
*/
|
|
|
|
#include <k32.h>
|
|
|
|
#define NDEBUG
|
|
#include <kernel32/kernel32.h>
|
|
|
|
/*
|
|
* @implemented
|
|
*/
|
|
WINBOOL STDCALL
|
|
FindCloseChangeNotification (HANDLE hChangeHandle)
|
|
{
|
|
NtClose(hChangeHandle);
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
/*
|
|
* @implemented
|
|
*/
|
|
HANDLE
|
|
STDCALL
|
|
FindFirstChangeNotificationA (
|
|
LPCSTR lpPathName,
|
|
WINBOOL bWatchSubtree,
|
|
DWORD dwNotifyFilter
|
|
)
|
|
{
|
|
UNICODE_STRING PathNameU;
|
|
ANSI_STRING PathName;
|
|
HANDLE hNotify;
|
|
|
|
RtlInitAnsiString (&PathName,
|
|
(LPSTR)lpPathName);
|
|
|
|
/* convert ansi (or oem) string to unicode */
|
|
if (bIsFileApiAnsi)
|
|
{
|
|
RtlAnsiStringToUnicodeString (&PathNameU,
|
|
&PathName,
|
|
TRUE);
|
|
}
|
|
else
|
|
{
|
|
RtlOemStringToUnicodeString (&PathNameU,
|
|
&PathName,
|
|
TRUE);
|
|
}
|
|
|
|
hNotify = FindFirstChangeNotificationW (PathNameU.Buffer,
|
|
bWatchSubtree,
|
|
dwNotifyFilter);
|
|
|
|
RtlFreeUnicodeString(&PathNameU);
|
|
|
|
return hNotify;
|
|
}
|
|
|
|
|
|
/*
|
|
* @implemented
|
|
*/
|
|
HANDLE
|
|
STDCALL
|
|
FindFirstChangeNotificationW (
|
|
LPCWSTR lpPathName,
|
|
WINBOOL bWatchSubtree,
|
|
DWORD dwNotifyFilter
|
|
)
|
|
{
|
|
NTSTATUS Status;
|
|
UNICODE_STRING NtPathU;
|
|
IO_STATUS_BLOCK IoStatus;
|
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
|
HANDLE hDir;
|
|
|
|
/*
|
|
RtlDosPathNameToNtPathName takes a fully qualified file name "C:\Projects\LoadLibrary\Debug\TestDll.dll"
|
|
and returns something like "\??\C:\Projects\LoadLibrary\Debug\TestDll.dll."
|
|
If the file name cannot be interpreted, then the routine returns STATUS_OBJECT_PATH_SYNTAX_BAD and
|
|
ends execution.
|
|
*/
|
|
|
|
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpPathName,
|
|
&NtPathU,
|
|
NULL,
|
|
NULL))
|
|
{
|
|
SetLastErrorByStatus(STATUS_OBJECT_PATH_SYNTAX_BAD);
|
|
return INVALID_HANDLE_VALUE;
|
|
}
|
|
|
|
InitializeObjectAttributes (&ObjectAttributes,
|
|
&NtPathU,
|
|
0,
|
|
NULL,
|
|
NULL);
|
|
|
|
Status = NtOpenFile (hDir,
|
|
SYNCHRONIZE|FILE_LIST_DIRECTORY,
|
|
&ObjectAttributes,
|
|
&IoStatus,
|
|
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
|
|
FILE_DIRECTORY_FILE);
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
{
|
|
SetLastErrorByStatus(Status);
|
|
return INVALID_HANDLE_VALUE;
|
|
}
|
|
|
|
Status = NtNotifyChangeDirectoryFile(hDir,
|
|
NULL,
|
|
NULL,
|
|
NULL,
|
|
&IoStatus,
|
|
NULL,//Buffer,
|
|
0,//BufferLength,
|
|
dwNotifyFilter,
|
|
bWatchSubtree);
|
|
if (!NT_SUCCESS(Status))
|
|
{
|
|
SetLastErrorByStatus(Status);
|
|
return INVALID_HANDLE_VALUE;
|
|
}
|
|
|
|
return hDir;
|
|
}
|
|
|
|
|
|
/*
|
|
* @implemented
|
|
*/
|
|
WINBOOL
|
|
STDCALL
|
|
FindNextChangeNotification (
|
|
HANDLE hChangeHandle
|
|
)
|
|
{
|
|
IO_STATUS_BLOCK IoStatus;
|
|
NTSTATUS Status;
|
|
|
|
Status = NtNotifyChangeDirectoryFile(hChangeHandle,
|
|
NULL,
|
|
NULL,
|
|
NULL,
|
|
&IoStatus,
|
|
NULL,//Buffer,
|
|
0,//BufferLength,
|
|
FILE_NOTIFY_CHANGE_SECURITY,//meaningless for subsequent calls, but must contain a valid flag(s)
|
|
0//meaningless for subsequent calls
|
|
);
|
|
if (!NT_SUCCESS(Status))
|
|
{
|
|
SetLastErrorByStatus(Status);
|
|
return FALSE;
|
|
}
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
/* EOF */
|