From 9af695bf7bf4d57fcdf4532e1b5514a7775cbe04 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Tue, 28 Dec 2004 13:30:18 +0000 Subject: [PATCH] Implement CopyProfileDirectoryA/W. svn path=/trunk/; revision=12380 --- reactos/lib/userenv/directory.c | 50 +++++++++++++++++++++++++++++++- reactos/lib/userenv/userenv.def | 2 ++ reactos/w32api/include/userenv.h | 4 +++ 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/reactos/lib/userenv/directory.c b/reactos/lib/userenv/directory.c index 631d90a01a0..58f8c0478e6 100644 --- a/reactos/lib/userenv/directory.c +++ b/reactos/lib/userenv/directory.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: directory.c,v 1.7 2004/11/09 15:02:35 ion Exp $ +/* $Id: directory.c,v 1.8 2004/12/28 13:30:18 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -30,6 +30,54 @@ /* FUNCTIONS ***************************************************************/ +BOOL STDCALL +CopyProfileDirectoryA(LPCSTR lpSourcePath, + LPCSTR lpDestinationPath, + DWORD dwFlags) +{ + UNICODE_STRING SrcPath; + UNICODE_STRING DstPath; + NTSTATUS Status; + BOOL bResult; + + Status = RtlCreateUnicodeStringFromAsciiz(&SrcPath, + (LPSTR)lpSourcePath); + if (!NT_SUCCESS(Status)) + { + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + Status = RtlCreateUnicodeStringFromAsciiz(&DstPath, + (LPSTR)lpDestinationPath); + if (!NT_SUCCESS(Status)) + { + RtlFreeUnicodeString(&SrcPath); + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + bResult = CopyProfileDirectoryW(SrcPath.Buffer, + DstPath.Buffer, + dwFlags); + + RtlFreeUnicodeString(&DstPath); + RtlFreeUnicodeString(&SrcPath); + + return bResult; +} + + +BOOL STDCALL +CopyProfileDirectoryW(LPCWSTR lpSourcePath, + LPCWSTR lpDestinationPath, + DWORD dwFlags) +{ + /* FIXME: dwFlags are ignored! */ + return CopyDirectory(lpDestinationPath, lpSourcePath); +} + + BOOL CopyDirectory (LPCWSTR lpDestinationPath, LPCWSTR lpSourcePath) diff --git a/reactos/lib/userenv/userenv.def b/reactos/lib/userenv/userenv.def index 5536bf26be0..bd4cdda27d5 100644 --- a/reactos/lib/userenv/userenv.def +++ b/reactos/lib/userenv/userenv.def @@ -11,6 +11,8 @@ DeleteItemA@16 @107 NONAME DeleteItemW@16 @108 NONAME CreateUserProfileA@8 @109 NONAME CreateUserProfileW@8 @110 NONAME +CopyProfileDirectoryA@12 @111 NONAME +CopyProfileDirectoryW@12 @112 NONAME AddDesktopItemA@32 @113 NONAME AddDesktopItemW@32 @114 NONAME DeleteDesktopItemA@8 @115 NONAME diff --git a/reactos/w32api/include/userenv.h b/reactos/w32api/include/userenv.h index 003ff700059..064806c9c9c 100644 --- a/reactos/w32api/include/userenv.h +++ b/reactos/w32api/include/userenv.h @@ -52,6 +52,8 @@ BOOL WINAPI AddItemA (LPCSTR, BOOL, LPCSTR, LPCSTR, LPCSTR, INT, LPCSTR, WORD, I BOOL WINAPI AddItemW (LPCWSTR, BOOL, LPCWSTR, LPCWSTR, LPCWSTR, INT, LPCWSTR, WORD, INT); BOOL WINAPI DeleteItemA (LPCSTR, BOOL, LPCSTR, BOOL); BOOL WINAPI DeleteItemW (LPCWSTR, BOOL, LPCWSTR, BOOL); +BOOL WINAPI CopyProfileDirectoryA(LPCSTR, LPCSTR, DWORD); +BOOL WINAPI CopyProfileDirectoryW(LPCWSTR, LPCWSTR, DWORD); /* end private */ BOOL WINAPI LoadUserProfileA (HANDLE, LPPROFILEINFOA); BOOL WINAPI LoadUserProfileW (HANDLE, LPPROFILEINFOW); @@ -80,6 +82,7 @@ typedef LPPROFILEINFOW LPPROFILEINFO; #define DeleteGroup DeleteGroupW #define AddItem AddItemW #define DeleteItem DeleteItemW +#define CopyProfileDirectory CopyProfileDirectoryW /* end private */ #define LoadUserProfile LoadUserProfileW #define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryW @@ -97,6 +100,7 @@ typedef LPPROFILEINFOA LPPROFILEINFO; #define DeleteGroup DeleteGroupA #define AddItem AddItemA #define DeleteItem DeleteItemA +#define CopyProfileDirectory CopyProfileDirectoryA /* end private */ #define LoadUserProfile LoadUserProfileA #define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryA