implemented SetFileAttributesByHandle() and GetFileAttributesByHandle()
Modified: trunk/reactos/lib/kernel32/file/file.c
Modified: trunk/reactos/lib/kernel32/kernel32.def
_____
Modified: trunk/reactos/lib/kernel32/file/file.c
--- trunk/reactos/lib/kernel32/file/file.c 2005-08-24 23:44:27 UTC
(rev 17529)
+++ trunk/reactos/lib/kernel32/file/file.c 2005-08-24 23:59:03 UTC
(rev 17530)
@@ -964,7 +964,81 @@
return Result ? FileAttributeData.dwFileAttributes :
INVALID_FILE_ATTRIBUTES;
}
+
+/*
+ * @implemented
+ */
BOOL STDCALL
+GetFileAttributesByHandle(IN HANDLE hFile,
+ OUT LPDWORD dwFileAttributes,
+ IN DWORD dwFlags)
+{
+ FILE_BASIC_INFORMATION FileBasic;
+ IO_STATUS_BLOCK IoStatusBlock;
+ NTSTATUS Status;
+
+ UNREFERENCED_PARAMETER(dwFlags);
+
+ Status = NtQueryInformationFile(hFile,
+ &IoStatusBlock,
+ &FileBasic,
+ sizeof(FileBasic),
+ FileBasicInformation);
+ if (NT_SUCCESS(Status))
+ {
+ *dwFileAttributes = FileBasic.FileAttributes;
+ return TRUE;
+ }
+
+ SetLastErrorByStatus(Status);
+ return FALSE;
+}
+
+
+/*
+ * @implemented
+ */
+BOOL STDCALL
+SetFileAttributesByHandle(IN HANDLE hFile,
+ IN DWORD dwFileAttributes,
+ IN DWORD dwFlags)
+{
+ FILE_BASIC_INFORMATION FileBasic;
+ IO_STATUS_BLOCK IoStatusBlock;
+ NTSTATUS Status;
+
+ UNREFERENCED_PARAMETER(dwFlags);
+
+ Status = NtQueryInformationFile(hFile,
+ &IoStatusBlock,
+ &FileBasic,
+ sizeof(FileBasic),
+ FileBasicInformation);
+ if (NT_SUCCESS(Status))
+ {
+ FileBasic.FileAttributes = dwFileAttributes;
+
+ Status = NtSetInformationFile(hFile,
+ &IoStatusBlock,
+ &FileBasic,
+ sizeof(FileBasic),
+ FileBasicInformation);
+ }
+
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastErrorByStatus(Status);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * @implemented
+ */
+BOOL STDCALL
SetFileAttributesA(
LPCSTR lpFileName,
DWORD dwFileAttributes)
_____
Modified: trunk/reactos/lib/kernel32/kernel32.def
--- trunk/reactos/lib/kernel32/kernel32.def 2005-08-24 23:44:27 UTC
(rev 17529)
+++ trunk/reactos/lib/kernel32/kernel32.def 2005-08-24 23:59:03 UTC
(rev 17530)
@@ -372,6 +372,7 @@
GetExpandedNameW@8
GetFileAttributesA@4
GetFileAttributesW@4
+GetFileAttributesByHandle@12
GetFileAttributesExA@12
GetFileAttributesExW@12
GetFileInformationByHandle@8
@@ -805,6 +806,7 @@
SetFileApisToOEM@0
SetFileAttributesA@8
SetFileAttributesW@8
+SetFileAttributesByHandle@12
SetFilePointer@16
SetFilePointerEx@20
SetFileShortNameA@8
Show replies by date