2004-01-15 01:20:46 +01:00
|
|
|
/*
|
|
|
|
* File handling functions
|
|
|
|
*
|
|
|
|
* Copyright 1993 Erik Bos
|
2004-05-01 07:25:07 +02:00
|
|
|
* Copyright 1996, 2004 Alexandre Julliard
|
2004-01-15 01:20:46 +01:00
|
|
|
* Copyright 2003 Eric Pouech
|
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-01-15 01:20:46 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2004-04-22 00:27:34 +02:00
|
|
|
#include <errno.h>
|
|
|
|
#include <stdio.h>
|
2004-01-15 01:20:46 +01:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "winerror.h"
|
|
|
|
#include "ntstatus.h"
|
2005-11-28 17:32:54 +01:00
|
|
|
#define WIN32_NO_STATUS
|
2004-01-15 01:20:46 +01:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
2020-09-28 16:34:11 +02:00
|
|
|
#include "winnls.h"
|
2004-01-15 01:20:46 +01:00
|
|
|
#include "winternl.h"
|
|
|
|
|
2004-03-26 00:41:04 +01:00
|
|
|
#include "kernel_private.h"
|
2004-01-15 01:20:46 +01:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(file);
|
|
|
|
|
|
|
|
#define MAX_PATHNAME_LEN 1024
|
|
|
|
|
2004-05-13 22:21:25 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* copy_filename_WtoA
|
|
|
|
*
|
|
|
|
* copy a file name back to OEM/Ansi, but only if the buffer is large enough
|
|
|
|
*/
|
|
|
|
static DWORD copy_filename_WtoA( LPCWSTR nameW, LPSTR buffer, DWORD len )
|
|
|
|
{
|
|
|
|
UNICODE_STRING strW;
|
|
|
|
DWORD ret;
|
|
|
|
BOOL is_ansi = AreFileApisANSI();
|
|
|
|
|
|
|
|
RtlInitUnicodeString( &strW, nameW );
|
|
|
|
|
|
|
|
ret = is_ansi ? RtlUnicodeStringToAnsiSize(&strW) : RtlUnicodeStringToOemSize(&strW);
|
|
|
|
if (buffer && ret <= len)
|
|
|
|
{
|
|
|
|
ANSI_STRING str;
|
|
|
|
|
|
|
|
str.Buffer = buffer;
|
2010-02-01 13:22:41 +01:00
|
|
|
str.MaximumLength = min( len, UNICODE_STRING_MAX_CHARS );
|
2004-05-13 22:21:25 +02:00
|
|
|
if (is_ansi)
|
|
|
|
RtlUnicodeStringToAnsiString( &str, &strW, FALSE );
|
|
|
|
else
|
|
|
|
RtlUnicodeStringToOemString( &str, &strW, FALSE );
|
|
|
|
ret = str.Length; /* length without terminating 0 */
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
2004-04-22 00:27:34 +02:00
|
|
|
|
2004-01-15 01:20:46 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* GetShortPathNameA (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath, DWORD shortlen )
|
|
|
|
{
|
2004-05-13 22:21:25 +02:00
|
|
|
WCHAR *longpathW;
|
2004-01-15 01:20:46 +01:00
|
|
|
WCHAR shortpathW[MAX_PATH];
|
2004-05-13 22:21:25 +02:00
|
|
|
DWORD ret;
|
2004-01-15 01:20:46 +01:00
|
|
|
|
|
|
|
TRACE("%s\n", debugstr_a(longpath));
|
|
|
|
|
2004-05-13 22:21:25 +02:00
|
|
|
if (!(longpathW = FILE_name_AtoW( longpath, FALSE ))) return 0;
|
2004-01-15 01:20:46 +01:00
|
|
|
|
2004-05-13 22:21:25 +02:00
|
|
|
ret = GetShortPathNameW(longpathW, shortpathW, MAX_PATH);
|
2004-01-15 01:20:46 +01:00
|
|
|
|
2004-05-13 22:21:25 +02:00
|
|
|
if (!ret) return 0;
|
|
|
|
if (ret > MAX_PATH)
|
2004-01-15 01:20:46 +01:00
|
|
|
{
|
|
|
|
SetLastError(ERROR_FILENAME_EXCED_RANGE);
|
2004-05-13 22:21:25 +02:00
|
|
|
return 0;
|
2004-01-15 01:20:46 +01:00
|
|
|
}
|
2004-05-13 22:21:25 +02:00
|
|
|
return copy_filename_WtoA( shortpathW, shortpath, shortlen );
|
2004-01-15 01:20:46 +01:00
|
|
|
}
|
2004-03-26 00:41:04 +01:00
|
|
|
|
2004-04-22 00:27:34 +02:00
|
|
|
|
2013-01-17 21:28:43 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* CopyFileA (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CopyFileA( LPCSTR source, LPCSTR dest, BOOL fail_if_exists)
|
|
|
|
{
|
|
|
|
WCHAR *sourceW, *destW;
|
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
if (!(sourceW = FILE_name_AtoW( source, FALSE ))) return FALSE;
|
|
|
|
if (!(destW = FILE_name_AtoW( dest, TRUE ))) return FALSE;
|
|
|
|
|
|
|
|
ret = CopyFileW( sourceW, destW, fail_if_exists );
|
|
|
|
|
|
|
|
HeapFree( GetProcessHeap(), 0, destW );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-01 07:25:07 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* CopyFileExA (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CopyFileExA(LPCSTR sourceFilename, LPCSTR destFilename,
|
|
|
|
LPPROGRESS_ROUTINE progressRoutine, LPVOID appData,
|
|
|
|
LPBOOL cancelFlagPointer, DWORD copyFlags)
|
|
|
|
{
|
2004-05-13 22:21:25 +02:00
|
|
|
WCHAR *sourceW, *destW;
|
2004-05-01 07:25:07 +02:00
|
|
|
BOOL ret;
|
|
|
|
|
2004-05-13 22:21:25 +02:00
|
|
|
/* can't use the TEB buffer since we may have a callback routine */
|
|
|
|
if (!(sourceW = FILE_name_AtoW( sourceFilename, TRUE ))) return FALSE;
|
|
|
|
if (!(destW = FILE_name_AtoW( destFilename, TRUE )))
|
2004-05-01 07:25:07 +02:00
|
|
|
{
|
2004-05-13 22:21:25 +02:00
|
|
|
HeapFree( GetProcessHeap(), 0, sourceW );
|
2004-05-01 07:25:07 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
2004-05-13 22:21:25 +02:00
|
|
|
ret = CopyFileExW(sourceW, destW, progressRoutine, appData,
|
2004-05-01 07:25:07 +02:00
|
|
|
cancelFlagPointer, copyFlags);
|
2004-05-13 22:21:25 +02:00
|
|
|
HeapFree( GetProcessHeap(), 0, sourceW );
|
|
|
|
HeapFree( GetProcessHeap(), 0, destW );
|
2004-05-01 07:25:07 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2018-10-15 14:28:32 +02:00
|
|
|
/**************************************************************************
|
|
|
|
* MoveFileTransactedA (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI MoveFileTransactedA(const char *source, const char *dest, LPPROGRESS_ROUTINE progress, void *data, DWORD flags, HANDLE handle)
|
|
|
|
{
|
|
|
|
FIXME("(%s, %s, %p, %p, %d, %p)\n", debugstr_a(source), debugstr_a(dest), progress, data, flags, handle);
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* MoveFileTransactedW (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI MoveFileTransactedW(const WCHAR *source, const WCHAR *dest, LPPROGRESS_ROUTINE progress, void *data, DWORD flags, HANDLE handle)
|
|
|
|
{
|
|
|
|
FIXME("(%s, %s, %p, %p, %d, %p)\n", debugstr_w(source), debugstr_w(dest), progress, data, flags, handle);
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2004-05-01 07:25:07 +02:00
|
|
|
|
2004-04-22 00:27:34 +02:00
|
|
|
/**************************************************************************
|
2007-01-02 03:40:00 +01:00
|
|
|
* MoveFileWithProgressA (KERNEL32.@)
|
2004-04-22 00:27:34 +02:00
|
|
|
*/
|
2007-01-02 03:40:00 +01:00
|
|
|
BOOL WINAPI MoveFileWithProgressA( LPCSTR source, LPCSTR dest,
|
|
|
|
LPPROGRESS_ROUTINE fnProgress,
|
|
|
|
LPVOID param, DWORD flag )
|
2004-04-22 00:27:34 +02:00
|
|
|
{
|
2004-05-13 22:21:25 +02:00
|
|
|
WCHAR *sourceW, *destW;
|
2004-04-22 00:27:34 +02:00
|
|
|
BOOL ret;
|
|
|
|
|
2004-05-13 22:21:25 +02:00
|
|
|
if (!(sourceW = FILE_name_AtoW( source, FALSE ))) return FALSE;
|
2005-09-07 11:23:34 +02:00
|
|
|
if (dest)
|
|
|
|
{
|
|
|
|
if (!(destW = FILE_name_AtoW( dest, TRUE ))) return FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
destW = NULL;
|
|
|
|
|
2007-01-02 03:40:00 +01:00
|
|
|
ret = MoveFileWithProgressW( sourceW, destW, fnProgress, param, flag );
|
2004-05-13 22:21:25 +02:00
|
|
|
HeapFree( GetProcessHeap(), 0, destW );
|
2004-04-22 00:27:34 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2007-01-02 03:40:00 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* MoveFileExA (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI MoveFileExA( LPCSTR source, LPCSTR dest, DWORD flag )
|
|
|
|
{
|
|
|
|
return MoveFileWithProgressA( source, dest, NULL, NULL, flag );
|
|
|
|
}
|
|
|
|
|
2004-04-22 00:27:34 +02:00
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* MoveFileW (KERNEL32.@)
|
|
|
|
*
|
|
|
|
* Move file or directory
|
|
|
|
*/
|
|
|
|
BOOL WINAPI MoveFileW( LPCWSTR source, LPCWSTR dest )
|
|
|
|
{
|
|
|
|
return MoveFileExW( source, dest, MOVEFILE_COPY_ALLOWED );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* MoveFileA (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI MoveFileA( LPCSTR source, LPCSTR dest )
|
|
|
|
{
|
|
|
|
return MoveFileExA( source, dest, MOVEFILE_COPY_ALLOWED );
|
|
|
|
}
|
2004-04-23 04:46:18 +02:00
|
|
|
|
|
|
|
|
2004-04-27 04:27:09 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* CreateDirectoryExA (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CreateDirectoryExA( LPCSTR template, LPCSTR path, LPSECURITY_ATTRIBUTES sa )
|
|
|
|
{
|
2004-05-13 22:21:25 +02:00
|
|
|
WCHAR *pathW, *templateW = NULL;
|
2004-04-27 04:27:09 +02:00
|
|
|
BOOL ret;
|
|
|
|
|
2004-05-13 22:21:25 +02:00
|
|
|
if (!(pathW = FILE_name_AtoW( path, FALSE ))) return FALSE;
|
|
|
|
if (template && !(templateW = FILE_name_AtoW( template, TRUE ))) return FALSE;
|
2004-04-27 04:27:09 +02:00
|
|
|
|
2004-05-13 22:21:25 +02:00
|
|
|
ret = CreateDirectoryExW( templateW, pathW, sa );
|
2004-12-23 18:06:43 +01:00
|
|
|
HeapFree( GetProcessHeap(), 0, templateW );
|
2004-04-27 04:27:09 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-13 22:21:25 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* GetSystemDirectoryW (KERNEL32.@)
|
|
|
|
*
|
|
|
|
* See comment for GetWindowsDirectoryA.
|
|
|
|
*/
|
|
|
|
UINT WINAPI GetSystemDirectoryW( LPWSTR path, UINT count )
|
|
|
|
{
|
2020-09-28 16:34:11 +02:00
|
|
|
UINT len = lstrlenW( DIR_System ) + 1;
|
2004-05-13 22:21:25 +02:00
|
|
|
if (path && count >= len)
|
2004-04-28 03:04:24 +02:00
|
|
|
{
|
2020-09-28 16:34:11 +02:00
|
|
|
lstrcpyW( path, DIR_System );
|
2004-05-13 22:21:25 +02:00
|
|
|
len--;
|
2004-04-28 03:04:24 +02:00
|
|
|
}
|
2004-05-13 22:21:25 +02:00
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetSystemDirectoryA (KERNEL32.@)
|
|
|
|
*
|
|
|
|
* See comment for GetWindowsDirectoryA.
|
|
|
|
*/
|
|
|
|
UINT WINAPI GetSystemDirectoryA( LPSTR path, UINT count )
|
|
|
|
{
|
|
|
|
return copy_filename_WtoA( DIR_System, path, count );
|
2004-04-28 03:04:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-07-06 15:09:29 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* Wow64EnableWow64FsRedirection (KERNEL32.@)
|
2019-12-05 20:09:04 +01:00
|
|
|
*
|
|
|
|
* Microsoft C++ Redistributable installers are depending on all %eax bits being set.
|
2009-07-06 15:09:29 +02:00
|
|
|
*/
|
2019-12-05 20:09:04 +01:00
|
|
|
DWORD /*BOOLEAN*/ WINAPI KERNEL32_Wow64EnableWow64FsRedirection( BOOLEAN enable )
|
2009-07-06 15:09:29 +02:00
|
|
|
{
|
2019-10-01 09:36:16 +02:00
|
|
|
return set_ntstatus( RtlWow64EnableFsRedirection( enable ));
|
2009-07-06 15:09:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-04-23 04:46:18 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* wine_get_unix_file_name (KERNEL32.@) Not a Windows API
|
|
|
|
*
|
|
|
|
* Return the full Unix file name for a given path.
|
|
|
|
* Returned buffer must be freed by caller.
|
|
|
|
*/
|
2009-02-06 13:56:09 +01:00
|
|
|
char * CDECL wine_get_unix_file_name( LPCWSTR dosW )
|
2004-04-23 04:46:18 +02:00
|
|
|
{
|
|
|
|
UNICODE_STRING nt_name;
|
|
|
|
NTSTATUS status;
|
2020-07-09 09:59:08 +02:00
|
|
|
SIZE_T size = 256;
|
|
|
|
char *buffer;
|
2004-04-23 04:46:18 +02:00
|
|
|
|
|
|
|
if (!RtlDosPathNameToNtPathName_U( dosW, &nt_name, NULL, NULL )) return NULL;
|
2020-07-09 09:59:08 +02:00
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, size )))
|
|
|
|
{
|
|
|
|
RtlFreeUnicodeString( &nt_name );
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
status = wine_nt_to_unix_file_name( &nt_name, buffer, &size, FILE_OPEN_IF );
|
|
|
|
if (status != STATUS_BUFFER_TOO_SMALL) break;
|
|
|
|
HeapFree( GetProcessHeap(), 0, buffer );
|
|
|
|
}
|
2004-04-23 04:46:18 +02:00
|
|
|
RtlFreeUnicodeString( &nt_name );
|
2005-08-11 13:07:17 +02:00
|
|
|
if (status && status != STATUS_NO_SUCH_FILE)
|
|
|
|
{
|
2020-07-09 09:59:08 +02:00
|
|
|
HeapFree( GetProcessHeap(), 0, buffer );
|
2005-08-11 13:07:17 +02:00
|
|
|
SetLastError( RtlNtStatusToDosError( status ) );
|
|
|
|
return NULL;
|
|
|
|
}
|
2020-07-09 09:59:08 +02:00
|
|
|
return buffer;
|
2004-04-23 04:46:18 +02:00
|
|
|
}
|
2005-08-11 13:07:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* wine_get_dos_file_name (KERNEL32.@) Not a Windows API
|
|
|
|
*
|
|
|
|
* Return the full DOS file name for a given Unix path.
|
|
|
|
* Returned buffer must be freed by caller.
|
|
|
|
*/
|
2009-02-06 13:56:09 +01:00
|
|
|
WCHAR * CDECL wine_get_dos_file_name( LPCSTR str )
|
2005-08-11 13:07:17 +02:00
|
|
|
{
|
|
|
|
UNICODE_STRING nt_name;
|
2020-07-08 13:53:14 +02:00
|
|
|
NTSTATUS status;
|
|
|
|
WCHAR *buffer;
|
2020-07-09 10:03:15 +02:00
|
|
|
SIZE_T len = strlen(str) + 1;
|
2005-08-11 13:07:17 +02:00
|
|
|
|
2020-07-08 13:53:14 +02:00
|
|
|
if (str[0] != '/') /* relative path name */
|
|
|
|
{
|
|
|
|
if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL;
|
|
|
|
MultiByteToWideChar( CP_UNIXCP, 0, str, len, buffer, len );
|
|
|
|
status = RtlDosPathNameToNtPathName_U_WithStatus( buffer, &nt_name, NULL, NULL );
|
|
|
|
RtlFreeHeap( GetProcessHeap(), 0, buffer );
|
2020-07-09 10:03:15 +02:00
|
|
|
if (!set_ntstatus( status )) return NULL;
|
|
|
|
buffer = nt_name.Buffer;
|
|
|
|
len = nt_name.Length / sizeof(WCHAR) + 1;
|
2020-07-08 13:53:14 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-07-09 10:03:15 +02:00
|
|
|
len += 8; /* \??\unix prefix */
|
|
|
|
if (!(buffer = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL;
|
|
|
|
if (!set_ntstatus( wine_unix_to_nt_file_name( str, buffer, &len )))
|
|
|
|
{
|
|
|
|
HeapFree( GetProcessHeap(), 0, buffer );
|
|
|
|
return NULL;
|
|
|
|
}
|
2020-07-08 13:53:14 +02:00
|
|
|
}
|
2020-07-09 10:03:15 +02:00
|
|
|
if (buffer[5] == ':')
|
2010-07-22 21:38:59 +02:00
|
|
|
{
|
|
|
|
/* get rid of the \??\ prefix */
|
|
|
|
/* FIXME: should implement RtlNtPathNameToDosPathName and use that instead */
|
2020-07-09 10:03:15 +02:00
|
|
|
memmove( buffer, buffer + 4, (len - 4) * sizeof(WCHAR) );
|
2010-07-22 21:38:59 +02:00
|
|
|
}
|
2020-07-09 10:03:15 +02:00
|
|
|
else buffer[1] = '\\';
|
|
|
|
return buffer;
|
2005-08-11 13:07:17 +02:00
|
|
|
}
|
2014-12-02 21:35:06 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* CreateSymbolicLinkA (KERNEL32.@)
|
|
|
|
*/
|
2015-10-30 15:49:09 +01:00
|
|
|
BOOLEAN WINAPI CreateSymbolicLinkA(LPCSTR link, LPCSTR target, DWORD flags)
|
2014-12-02 21:35:06 +01:00
|
|
|
{
|
|
|
|
FIXME("(%s %s %d): stub\n", debugstr_a(link), debugstr_a(target), flags);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2015-02-04 21:51:42 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* CreateHardLinkTransactedA (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CreateHardLinkTransactedA(LPCSTR link, LPCSTR target, LPSECURITY_ATTRIBUTES sa, HANDLE transaction)
|
|
|
|
{
|
|
|
|
FIXME("(%s %s %p %p): stub\n", debugstr_a(link), debugstr_a(target), sa, transaction);
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* CreateHardLinkTransactedW (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CreateHardLinkTransactedW(LPCWSTR link, LPCWSTR target, LPSECURITY_ATTRIBUTES sa, HANDLE transaction)
|
|
|
|
{
|
|
|
|
FIXME("(%s %s %p %p): stub\n", debugstr_w(link), debugstr_w(target), sa, transaction);
|
|
|
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2015-05-12 20:31:01 +02:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* CheckNameLegalDOS8Dot3A (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CheckNameLegalDOS8Dot3A(const char *name, char *oemname, DWORD oemname_len,
|
|
|
|
BOOL *contains_spaces, BOOL *is_legal)
|
|
|
|
{
|
|
|
|
WCHAR *nameW;
|
|
|
|
|
|
|
|
TRACE("(%s %p %u %p %p)\n", name, oemname,
|
|
|
|
oemname_len, contains_spaces, is_legal);
|
|
|
|
|
|
|
|
if (!name || !is_legal)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!(nameW = FILE_name_AtoW( name, FALSE ))) return FALSE;
|
|
|
|
|
|
|
|
return CheckNameLegalDOS8Dot3W( nameW, oemname, oemname_len, contains_spaces, is_legal );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* CheckNameLegalDOS8Dot3W (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CheckNameLegalDOS8Dot3W(const WCHAR *name, char *oemname, DWORD oemname_len,
|
|
|
|
BOOL *contains_spaces_ret, BOOL *is_legal)
|
|
|
|
{
|
|
|
|
OEM_STRING oem_str;
|
|
|
|
UNICODE_STRING nameW;
|
|
|
|
BOOLEAN contains_spaces;
|
|
|
|
|
|
|
|
TRACE("(%s %p %u %p %p)\n", wine_dbgstr_w(name), oemname,
|
|
|
|
oemname_len, contains_spaces_ret, is_legal);
|
|
|
|
|
|
|
|
if (!name || !is_legal)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
RtlInitUnicodeString( &nameW, name );
|
|
|
|
|
|
|
|
if (oemname) {
|
|
|
|
oem_str.Length = oemname_len;
|
|
|
|
oem_str.MaximumLength = oemname_len;
|
|
|
|
oem_str.Buffer = oemname;
|
|
|
|
}
|
|
|
|
|
|
|
|
*is_legal = RtlIsNameLegalDOS8Dot3( &nameW, oemname ? &oem_str : NULL, &contains_spaces );
|
|
|
|
if (contains_spaces_ret) *contains_spaces_ret = contains_spaces;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2016-01-08 05:02:37 +01:00
|
|
|
|
2016-09-26 23:17:37 +02:00
|
|
|
/*************************************************************************
|
|
|
|
* SetSearchPathMode (KERNEL32.@)
|
|
|
|
*/
|
2017-08-29 15:46:50 +02:00
|
|
|
BOOL WINAPI SetSearchPathMode( DWORD flags )
|
2016-01-08 05:02:37 +01:00
|
|
|
{
|
2019-10-01 09:35:59 +02:00
|
|
|
return set_ntstatus( RtlSetSearchPathMode( flags ));
|
2016-01-08 05:02:37 +01:00
|
|
|
}
|