Alexandre Julliard : ntdll: Get rid of the almost empty directory.c.

Alexandre Julliard julliard at winehq.org
Mon Jul 5 16:24:19 CDT 2021


Module: wine
Branch: master
Commit: 73a281104bd2df7d5dcd1106724d81f82b38b160
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=73a281104bd2df7d5dcd1106724d81f82b38b160

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jul  5 12:22:32 2021 +0200

ntdll: Get rid of the almost empty directory.c.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/Makefile.in |   1 -
 dlls/ntdll/directory.c | 100 -------------------------------------------------
 dlls/ntdll/path.c      |  19 ++++++++++
 dlls/ntdll/process.c   |  33 ++++++++++++++++
 4 files changed, 52 insertions(+), 101 deletions(-)

diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in
index b0607952431..eb125c07722 100644
--- a/dlls/ntdll/Makefile.in
+++ b/dlls/ntdll/Makefile.in
@@ -12,7 +12,6 @@ C_SRCS = \
 	critsection.c \
 	crypt.c \
 	debugbuffer.c \
-	directory.c \
 	env.c \
 	error.c \
 	exception.c \
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
deleted file mode 100644
index 3c601fe016a..00000000000
--- a/dlls/ntdll/directory.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * NTDLL directory functions
- *
- * Copyright 1993 Erik Bos
- * Copyright 2003 Eric Pouech
- * Copyright 1996, 2004 Alexandre Julliard
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include <assert.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <stdarg.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "ntstatus.h"
-#define WIN32_NO_STATUS
-#define NONAMELESSUNION
-#include "windef.h"
-#include "winnt.h"
-#include "winternl.h"
-#include "ddk/wdm.h"
-#include "ntdll_misc.h"
-#include "wine/list.h"
-#include "wine/debug.h"
-#include "wine/exception.h"
-
-
-/******************************************************************
- *		RtlWow64EnableFsRedirection   (NTDLL.@)
- */
-NTSTATUS WINAPI RtlWow64EnableFsRedirection( BOOLEAN enable )
-{
-    if (!NtCurrentTeb64()) return STATUS_NOT_IMPLEMENTED;
-    NtCurrentTeb64()->TlsSlots[WOW64_TLS_FILESYSREDIR] = !enable;
-    return STATUS_SUCCESS;
-}
-
-
-/******************************************************************
- *		RtlWow64EnableFsRedirectionEx   (NTDLL.@)
- */
-NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx( ULONG disable, ULONG *old_value )
-{
-    if (!NtCurrentTeb64()) return STATUS_NOT_IMPLEMENTED;
-
-    __TRY
-    {
-        *old_value = NtCurrentTeb64()->TlsSlots[WOW64_TLS_FILESYSREDIR];
-    }
-    __EXCEPT_PAGE_FAULT
-    {
-        return STATUS_ACCESS_VIOLATION;
-    }
-    __ENDTRY
-
-    NtCurrentTeb64()->TlsSlots[WOW64_TLS_FILESYSREDIR] = disable;
-    return STATUS_SUCCESS;
-}
-
-
-/******************************************************************
- *		RtlDoesFileExists_U   (NTDLL.@)
- */
-BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR file_name)
-{
-    UNICODE_STRING nt_name;
-    FILE_BASIC_INFORMATION basic_info;
-    OBJECT_ATTRIBUTES attr;
-    BOOLEAN ret;
-
-    if (!RtlDosPathNameToNtPathName_U( file_name, &nt_name, NULL, NULL )) return FALSE;
-
-    attr.Length = sizeof(attr);
-    attr.RootDirectory = 0;
-    attr.ObjectName = &nt_name;
-    attr.Attributes = OBJ_CASE_INSENSITIVE;
-    attr.SecurityDescriptor = NULL;
-    attr.SecurityQualityOfService = NULL;
-
-    ret = NtQueryAttributesFile(&attr, &basic_info) == STATUS_SUCCESS;
-
-    RtlFreeUnicodeString( &nt_name );
-    return ret;
-}
diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c
index 58983aca194..53be23fe4ec 100644
--- a/dlls/ntdll/path.c
+++ b/dlls/ntdll/path.c
@@ -768,6 +768,25 @@ DWORD WINAPI RtlGetLongestNtPathLength(void)
     return MAX_NT_PATH_LENGTH;
 }
 
+
+/******************************************************************
+ *             RtlDoesFileExists_U   (NTDLL.@)
+ */
+BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR file_name)
+{
+    UNICODE_STRING nt_name;
+    FILE_BASIC_INFORMATION basic_info;
+    OBJECT_ATTRIBUTES attr;
+    NTSTATUS status;
+
+    if (!RtlDosPathNameToNtPathName_U( file_name, &nt_name, NULL, NULL )) return FALSE;
+    InitializeObjectAttributes( &attr, &nt_name, OBJ_CASE_INSENSITIVE, 0, NULL );
+    status = NtQueryAttributesFile(&attr, &basic_info);
+    RtlFreeUnicodeString( &nt_name );
+    return !status;
+}
+
+
 /******************************************************************
  *             RtlIsNameLegalDOS8Dot3   (NTDLL.@)
  *
diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
index d10d731e3ef..160b1f549c9 100644
--- a/dlls/ntdll/process.c
+++ b/dlls/ntdll/process.c
@@ -49,6 +49,39 @@ PEB * WINAPI RtlGetCurrentPeb(void)
 }
 
 
+/******************************************************************
+ *		RtlWow64EnableFsRedirection   (NTDLL.@)
+ */
+NTSTATUS WINAPI RtlWow64EnableFsRedirection( BOOLEAN enable )
+{
+    if (!NtCurrentTeb64()) return STATUS_NOT_IMPLEMENTED;
+    NtCurrentTeb64()->TlsSlots[WOW64_TLS_FILESYSREDIR] = !enable;
+    return STATUS_SUCCESS;
+}
+
+
+/******************************************************************
+ *		RtlWow64EnableFsRedirectionEx   (NTDLL.@)
+ */
+NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx( ULONG disable, ULONG *old_value )
+{
+    if (!NtCurrentTeb64()) return STATUS_NOT_IMPLEMENTED;
+
+    __TRY
+    {
+        *old_value = NtCurrentTeb64()->TlsSlots[WOW64_TLS_FILESYSREDIR];
+    }
+    __EXCEPT_PAGE_FAULT
+    {
+        return STATUS_ACCESS_VIOLATION;
+    }
+    __ENDTRY
+
+    NtCurrentTeb64()->TlsSlots[WOW64_TLS_FILESYSREDIR] = disable;
+    return STATUS_SUCCESS;
+}
+
+
 /**********************************************************************
  *           RtlWow64GetCurrentMachine  (NTDLL.@)
  */




More information about the wine-cvs mailing list