Rebase against d318f43559dbb0093e22bab1aa0eb9dc01170cc2.

This commit is contained in:
Zebediah Figura
2022-02-11 23:53:24 -06:00
parent b5193cb799
commit b9f7ec5ccf
10 changed files with 148 additions and 146 deletions

View File

@@ -1,27 +1,27 @@
From 77515fff89d1e21aa47d3a95aacc5138054cdb77 Mon Sep 17 00:00:00 2001
From 73ce551bae8a040575c3f631b8f67a5eb79bda37 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 13 Mar 2019 16:02:05 -0600
Subject: kernel32: Implement CreateSymbolicLink[A|W] with ntdll reparse
points.
Subject: [PATCH] kernel32: Implement CreateSymbolicLink[A|W] with ntdll
reparse points.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
dlls/kernel32/path.c | 12 +++-
dlls/kernel32/tests/path.c | 94 ++++++++++++++++++++++++++++++
dlls/kernelbase/file.c | 103 ++++++++++++++++++++++++++++++++-
dlls/msvcp120/tests/msvcp120.c | 75 +++++++++++-------------
dlls/kernel32/tests/path.c | 94 +++++++++++++++++++++++++++++
dlls/kernelbase/file.c | 105 ++++++++++++++++++++++++++++++++-
dlls/msvcp120/tests/msvcp120.c | 75 +++++++++++------------
dlls/msvcp140/tests/msvcp140.c | 63 +++++++++-----------
5 files changed, 266 insertions(+), 81 deletions(-)
5 files changed, 267 insertions(+), 82 deletions(-)
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
index 957e9fca01d..ca2868c5635 100644
index 2dd3eac3c26..97428dd4d95 100644
--- a/dlls/kernel32/path.c
+++ b/dlls/kernel32/path.c
@@ -352,8 +352,16 @@ WCHAR * CDECL wine_get_dos_file_name( LPCSTR str )
*/
BOOLEAN WINAPI CreateSymbolicLinkA(LPCSTR link, LPCSTR target, DWORD flags)
{
- FIXME("(%s %s %d): stub\n", debugstr_a(link), debugstr_a(target), flags);
- FIXME("(%s %s %ld): stub\n", debugstr_a(link), debugstr_a(target), flags);
- return TRUE;
+ WCHAR *linkW, *targetW;
+ BOOL ret;
@@ -37,7 +37,7 @@ index 957e9fca01d..ca2868c5635 100644
/*************************************************************************
diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c
index 2955be0da9c..78326fc8bb1 100644
index db376eef24a..33a29ab1cea 100644
--- a/dlls/kernel32/tests/path.c
+++ b/dlls/kernel32/tests/path.c
@@ -83,6 +83,9 @@ static NTSTATUS (WINAPI *pLdrGetDllPath)(LPCWSTR,ULONG,LPWSTR*,LPWSTR*);
@@ -50,7 +50,7 @@ index 2955be0da9c..78326fc8bb1 100644
/* a structure to deal with wine todos somewhat cleanly */
typedef struct {
DWORD shortlen;
@@ -2148,6 +2151,7 @@ static void init_pointers(void)
@@ -2106,6 +2109,7 @@ static void init_pointers(void)
MAKEFUNC(SetDefaultDllDirectories);
MAKEFUNC(CheckNameLegalDOS8Dot3W);
MAKEFUNC(CheckNameLegalDOS8Dot3A);
@@ -58,7 +58,7 @@ index 2955be0da9c..78326fc8bb1 100644
mod = GetModuleHandleA("ntdll.dll");
MAKEFUNC(LdrGetDllPath);
MAKEFUNC(RtlGetExePath);
@@ -2734,6 +2738,95 @@ static void test_LdrGetDllPath(void)
@@ -2692,6 +2696,95 @@ static void test_LdrGetDllPath(void)
SetEnvironmentVariableW( pathW, old_path );
}
@@ -154,14 +154,14 @@ index 2955be0da9c..78326fc8bb1 100644
START_TEST(path)
{
CHAR origdir[MAX_PATH],curdir[MAX_PATH], curDrive, otherDrive;
@@ -2763,4 +2856,5 @@ START_TEST(path)
@@ -2721,4 +2814,5 @@ START_TEST(path)
test_RtlGetSearchPath();
test_RtlGetExePath();
test_LdrGetDllPath();
+ test_CreateSymbolicLink();
}
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
index 904a4f0979f..e44a5755460 100644
index 4ef43b83b66..c2f6a8307a8 100644
--- a/dlls/kernelbase/file.c
+++ b/dlls/kernelbase/file.c
@@ -38,6 +38,7 @@
@@ -172,11 +172,14 @@ index 904a4f0979f..e44a5755460 100644
#include "kernelbase.h"
#include "wine/exception.h"
@@ -940,8 +941,106 @@ done:
@@ -938,10 +939,108 @@ done:
/*************************************************************************
* CreateSymbolicLinkW (kernelbase.@)
*/
BOOLEAN WINAPI /* DECLSPEC_HOTPATCH */ CreateSymbolicLinkW( LPCWSTR link, LPCWSTR target, DWORD flags )
-BOOLEAN WINAPI /* DECLSPEC_HOTPATCH */ CreateSymbolicLinkW( LPCWSTR link, LPCWSTR target, DWORD flags )
+BOOLEAN WINAPI DECLSPEC_HOTPATCH CreateSymbolicLinkW( const WCHAR *link, const WCHAR *target, DWORD flags )
{
- FIXME( "(%s %s %d): stub\n", debugstr_w(link), debugstr_w(target), flags );
- FIXME( "(%s %s %ld): stub\n", debugstr_w(link), debugstr_w(target), flags );
- return TRUE;
+ static INT struct_size = offsetof(REPARSE_DATA_BUFFER, SymbolicLinkReparseBuffer.PathBuffer[0]);
+ static INT header_size = offsetof(REPARSE_DATA_BUFFER, GenericReparseBuffer);
@@ -192,7 +195,7 @@ index 904a4f0979f..e44a5755460 100644
+ HANDLE hlink;
+ DWORD dwret;
+
+ TRACE( "(%s %s %d): stub\n", debugstr_w(link), debugstr_w(target), flags );
+ TRACE( "(%s %s %#lx)\n", debugstr_w(link), debugstr_w(target), flags );
+
+ is_relative = (RtlDetermineDosPathNameType_U( target ) == RELATIVE_PATH);
+ is_dir = (flags & SYMBOLIC_LINK_FLAG_DIRECTORY);
@@ -282,10 +285,10 @@ index 904a4f0979f..e44a5755460 100644
diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c
index 495ee9dd6fb..c982be0c10e 100644
index 9e36071d06a..681acfc1c39 100644
--- a/dlls/msvcp120/tests/msvcp120.c
+++ b/dlls/msvcp120/tests/msvcp120.c
@@ -1609,15 +1609,14 @@ static void test_tr2_sys__Stat(void)
@@ -1613,15 +1613,14 @@ static void test_tr2_sys__Stat(void)
char const *path;
enum file_type ret;
int err_code;
@@ -308,7 +311,7 @@ index 495ee9dd6fb..c982be0c10e 100644
};
CreateDirectoryA("tr2_test_dir", NULL);
@@ -1660,16 +1659,14 @@ static void test_tr2_sys__Stat(void)
@@ -1664,16 +1663,14 @@ static void test_tr2_sys__Stat(void)
for(i=0; i<ARRAY_SIZE(tests); i++) {
err_code = 0xdeadbeef;
val = p_tr2_sys__Stat(tests[i].path, &err_code);
@@ -327,7 +330,7 @@ index 495ee9dd6fb..c982be0c10e 100644
ok(tests[i].err_code == err_code, "tr2_sys__Lstat(): test %d err_code expect: %d, got %d\n",
i+1, tests[i].err_code, err_code);
}
@@ -1684,8 +1681,8 @@ static void test_tr2_sys__Stat(void)
@@ -1688,8 +1685,8 @@ static void test_tr2_sys__Stat(void)
ok(ERROR_SUCCESS == err_code, "tr2_sys__Lstat_wchar(): err_code expect ERROR_SUCCESS, got %d\n", err_code);
if(ret) {
@@ -338,7 +341,7 @@ index 495ee9dd6fb..c982be0c10e 100644
}
ok(DeleteFileA("tr2_test_dir/f1"), "expect tr2_test_dir/f1 to exist\n");
ok(RemoveDirectoryA("tr2_test_dir"), "expect tr2_test_dir to exist\n");
@@ -1914,16 +1911,15 @@ static void test_tr2_sys__Symlink(void)
@@ -1918,16 +1915,15 @@ static void test_tr2_sys__Symlink(void)
char const *existing_path;
char const *new_path;
int last_error;
@@ -363,7 +366,7 @@ index 495ee9dd6fb..c982be0c10e 100644
};
ret = p_tr2_sys__Make_dir("tr2_test_dir");
@@ -1948,18 +1944,17 @@ static void test_tr2_sys__Symlink(void)
@@ -1952,18 +1948,17 @@ static void test_tr2_sys__Symlink(void)
}
ok(errno == 0xdeadbeef, "tr2_sys__Symlink(): test %d errno expect 0xdeadbeef, got %d\n", i+1, errno);
@@ -388,7 +391,7 @@ index 495ee9dd6fb..c982be0c10e 100644
ret = p_tr2_sys__Remove_dir("tr2_test_dir");
ok(ret == 1, "tr2_sys__Remove_dir(): expect 1 got %d\n", ret);
}
@@ -1973,15 +1968,14 @@ static void test_tr2_sys__Unlink(void)
@@ -1977,15 +1972,14 @@ static void test_tr2_sys__Unlink(void)
struct {
char const *path;
int last_error;
@@ -411,7 +414,7 @@ index 495ee9dd6fb..c982be0c10e 100644
};
GetCurrentDirectoryA(MAX_PATH, current_path);
@@ -2010,9 +2004,8 @@ static void test_tr2_sys__Unlink(void)
@@ -2014,9 +2008,8 @@ static void test_tr2_sys__Unlink(void)
for(i=0; i<ARRAY_SIZE(tests); i++) {
errno = 0xdeadbeef;
ret = p_tr2_sys__Unlink(tests[i].path);
@@ -535,5 +538,5 @@ index c79e425190b..f3b98ec4e73 100644
}
--
2.17.1
2.34.1