Implement DeleteItemW().

svn path=/trunk/; revision=9298
This commit is contained in:
Eric Kohl 2004-05-04 13:11:22 +00:00
parent a02cf9bbfb
commit 57aa128d43
4 changed files with 75 additions and 3 deletions

View file

@ -1,4 +1,4 @@
/* $Id: desktop.c,v 1.3 2004/05/03 12:05:44 ekohl Exp $
/* $Id: desktop.c,v 1.4 2004/05/04 13:11:22 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@ -141,7 +141,7 @@ AddDesktopItemA (BOOL bCommonItem,
BOOL WINAPI
AddDesktopItemW (BOOL bCommonItem,
AddDesktopItemW (BOOL bCommonDesktop,
LPCWSTR lpItemName,
LPCWSTR lpArguments,
LPCWSTR lpIconLocation,
@ -164,7 +164,7 @@ AddDesktopItemW (BOOL bCommonItem,
bResult = FALSE;
if (!GetDesktopPath (bCommonItem, szLinkPath))
if (!GetDesktopPath (bCommonDesktop, szLinkPath))
{
DPRINT1 ("GetDesktopPath() failed\n");
return FALSE;
@ -383,4 +383,68 @@ DeleteGroupW (LPCWSTR lpGroupName,
return TRUE;
}
BOOL WINAPI
DeleteItemA (LPCSTR lpGroupName,
BOOL bCommonGroup,
LPCSTR lpItemName,
BOOL bDeleteGroup)
{
DPRINT1 ("DeleteItemA() not implemented!\n");
return FALSE;
}
BOOL WINAPI
DeleteItemW (LPCWSTR lpGroupName,
BOOL bCommonGroup,
LPCWSTR lpItemName,
BOOL bDeleteGroup)
{
WCHAR szItemPath[MAX_PATH];
LPWSTR Ptr;
DPRINT ("DeleteItemW() called\n");
if (!GetProgramsPath (bCommonGroup, szItemPath))
{
DPRINT1 ("GetProgramsPath() failed\n");
return FALSE;
}
DPRINT ("Programs path: '%S'\n", szItemPath);
if (lpGroupName != NULL && *lpGroupName != 0)
{
wcscat (szItemPath, L"\\");
wcscat (szItemPath, lpGroupName);
}
wcscat (szItemPath, L"\\");
wcscat (szItemPath, lpItemName);
wcscat (szItemPath, L".lnk");
DPRINT ("Item path: '%S'\n", szItemPath);
if (!DeleteFileW (szItemPath))
return FALSE;
/* FIXME: Notify the shell */
if (bDeleteGroup)
{
Ptr = wcsrchr (szItemPath, L'\\');
if (Ptr == NULL)
return TRUE;
*Ptr = 0;
if (RemoveDirectoryW (szItemPath))
{
/* FIXME: Notify the shell */
}
}
DPRINT ("DeleteItemW() done\n");
return TRUE;
}
/* EOF */

View file

@ -5,6 +5,8 @@ CreateGroupA@8 @101 NONAME
CreateGroupW@8 @102 NONAME
DeleteGroupA@8 @103 NONAME
DeleteGroupW@8 @104 NONAME
DeleteItemA@16 @107 NONAME
DeleteItemW@16 @108 NONAME
CreateUserProfileA@8 @109 NONAME
CreateUserProfileW@8 @110 NONAME
AddDesktopItemA@32 @113 NONAME

View file

@ -5,6 +5,8 @@ CreateGroupA=CreateGroupA@8 @101 NONAME
CreateGroupW=CreateGroupW@8 @102 NONAME
DeleteGroupA=DeleteGroupA@8 @103 NONAME
DeleteGroupW=DeleteGroupW@8 @104 NONAME
DeleteItemA=DeleteItemA@16 @107 NONAME
DeleteItemW=DeleteItemW@16 @108 NONAME
CreateUserProfileA=CreateUserProfileA@8 @109 NONAME
CreateUserProfileW=CreateUserProfileW@8 @110 NONAME
AddDesktopItemA=AddDesktopItemA@32 @113 NONAME

View file

@ -48,6 +48,8 @@ BOOL WINAPI CreateGroupA (LPCSTR, BOOL);
BOOL WINAPI CreateGroupW (LPCWSTR, BOOL);
BOOL WINAPI DeleteGroupA (LPCSTR, BOOL);
BOOL WINAPI DeleteGroupW (LPCWSTR, BOOL);
BOOL WINAPI DeleteItemA (LPCSTR, BOOL, LPCSTR, BOOL);
BOOL WINAPI DeleteItemW (LPCWSTR, BOOL, LPCWSTR, BOOL);
/* end private */
BOOL WINAPI LoadUserProfileA (HANDLE, LPPROFILEINFOA);
BOOL WINAPI LoadUserProfileW (HANDLE, LPPROFILEINFOW);
@ -74,6 +76,7 @@ typedef LPPROFILEINFOW LPPROFILEINFO;
#define DeleteDesktopItem DeleteDesktopItemW
#define CreateGroup CreateGroupW
#define DeleteGroup DeleteGroupW
#define DeleteItem DeleteItemW
/* end private */
#define LoadUserProfile LoadUserProfileW
#define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryW
@ -89,6 +92,7 @@ typedef LPPROFILEINFOA LPPROFILEINFO;
#define DeleteDesktopItem DeleteDesktopItemA
#define CreateGroup CreateGroupA
#define DeleteGroup DeleteGroupA
#define DeleteItem DeleteItemA
/* end private */
#define LoadUserProfile LoadUserProfileA
#define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryA