wined3d: Pass a wined3d_device_context to wined3d_cs_emit_blt_sub_resource().
[wine/zf.git] / dlls / ntdll / directory.c
blob3c601fe016af72f3f4e1356828db82ecc1ddfb93
1 /*
2 * NTDLL directory functions
4 * Copyright 1993 Erik Bos
5 * Copyright 2003 Eric Pouech
6 * Copyright 1996, 2004 Alexandre Julliard
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include <assert.h>
24 #include <sys/types.h>
25 #include <fcntl.h>
26 #include <stdarg.h>
27 #include <string.h>
28 #include <stdlib.h>
29 #include <stdio.h>
31 #include "ntstatus.h"
32 #define WIN32_NO_STATUS
33 #define NONAMELESSUNION
34 #include "windef.h"
35 #include "winnt.h"
36 #include "winternl.h"
37 #include "ddk/wdm.h"
38 #include "ntdll_misc.h"
39 #include "wine/list.h"
40 #include "wine/debug.h"
41 #include "wine/exception.h"
44 /******************************************************************
45 * RtlWow64EnableFsRedirection (NTDLL.@)
47 NTSTATUS WINAPI RtlWow64EnableFsRedirection( BOOLEAN enable )
49 if (!NtCurrentTeb64()) return STATUS_NOT_IMPLEMENTED;
50 NtCurrentTeb64()->TlsSlots[WOW64_TLS_FILESYSREDIR] = !enable;
51 return STATUS_SUCCESS;
55 /******************************************************************
56 * RtlWow64EnableFsRedirectionEx (NTDLL.@)
58 NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx( ULONG disable, ULONG *old_value )
60 if (!NtCurrentTeb64()) return STATUS_NOT_IMPLEMENTED;
62 __TRY
64 *old_value = NtCurrentTeb64()->TlsSlots[WOW64_TLS_FILESYSREDIR];
66 __EXCEPT_PAGE_FAULT
68 return STATUS_ACCESS_VIOLATION;
70 __ENDTRY
72 NtCurrentTeb64()->TlsSlots[WOW64_TLS_FILESYSREDIR] = disable;
73 return STATUS_SUCCESS;
77 /******************************************************************
78 * RtlDoesFileExists_U (NTDLL.@)
80 BOOLEAN WINAPI RtlDoesFileExists_U(LPCWSTR file_name)
82 UNICODE_STRING nt_name;
83 FILE_BASIC_INFORMATION basic_info;
84 OBJECT_ATTRIBUTES attr;
85 BOOLEAN ret;
87 if (!RtlDosPathNameToNtPathName_U( file_name, &nt_name, NULL, NULL )) return FALSE;
89 attr.Length = sizeof(attr);
90 attr.RootDirectory = 0;
91 attr.ObjectName = &nt_name;
92 attr.Attributes = OBJ_CASE_INSENSITIVE;
93 attr.SecurityDescriptor = NULL;
94 attr.SecurityQualityOfService = NULL;
96 ret = NtQueryAttributesFile(&attr, &basic_info) == STATUS_SUCCESS;
98 RtlFreeUnicodeString( &nt_name );
99 return ret;