From 362610233e388928b1c7d67033047cae1afa97f6 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Thu, 25 Aug 2005 18:21:50 +0000 Subject: [PATCH] add stubs for CreateSymbolicLinkA/W svn path=/trunk/; revision=17542 --- reactos/lib/kernel32/file/create.c | 47 ++++++++++++++++++++++++++++++ reactos/lib/kernel32/kernel32.def | 2 ++ 2 files changed, 49 insertions(+) diff --git a/reactos/lib/kernel32/file/create.c b/reactos/lib/kernel32/file/create.c index d80b479bab5..168cb52eb16 100644 --- a/reactos/lib/kernel32/file/create.c +++ b/reactos/lib/kernel32/file/create.c @@ -357,4 +357,51 @@ HANDLE STDCALL CreateFileW (LPCWSTR lpFileName, return FileHandle; } + +/* + * @unimplemented + */ +BOOL STDCALL +CreateSymbolicLinkW(IN LPCWSTR lpSymlinkFileName, + IN LPCWSTR lpTargetFileName, + IN DWORD dwFlags) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + + +/* + * @implemented + */ +BOOL STDCALL +CreateSymbolicLinkA(IN LPCSTR lpSymlinkFileName, + IN LPCSTR lpTargetFileName, + IN DWORD dwFlags) +{ + PWCHAR SymlinkW, TargetW; + BOOL Ret; + + if(!lpSymlinkFileName || !lpTargetFileName) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (!(SymlinkW = FilenameA2W(lpSymlinkFileName, FALSE))) + return FALSE; + + if (!(TargetW = FilenameA2W(lpTargetFileName, TRUE))) + return FALSE; + + Ret = CreateSymbolicLinkW(SymlinkW, + TargetW, + dwFlags); + + RtlFreeHeap(RtlGetProcessHeap(), 0, TargetW); + + return Ret; +} + + /* EOF */ diff --git a/reactos/lib/kernel32/kernel32.def b/reactos/lib/kernel32/kernel32.def index 5dbcdd7b675..7d64ca07598 100644 --- a/reactos/lib/kernel32/kernel32.def +++ b/reactos/lib/kernel32/kernel32.def @@ -135,6 +135,8 @@ CreateRemoteThread@28 CreateSemaphoreA@16 CreateSemaphoreW@16 CreateSocketHandle@0 +CreateSymbolicLinkA@12 +CreateSymbolicLinkW@12 CreateTapePartition@16 CreateThread@24 CreateTimerQueue@0