mirror of
https://github.com/reactos/reactos.git
synced 2025-05-24 03:24:45 +00:00
Implement DeleteItemW().
svn path=/trunk/; revision=9298
This commit is contained in:
parent
a02cf9bbfb
commit
57aa128d43
4 changed files with 75 additions and 3 deletions
|
@ -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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -141,7 +141,7 @@ AddDesktopItemA (BOOL bCommonItem,
|
||||||
|
|
||||||
|
|
||||||
BOOL WINAPI
|
BOOL WINAPI
|
||||||
AddDesktopItemW (BOOL bCommonItem,
|
AddDesktopItemW (BOOL bCommonDesktop,
|
||||||
LPCWSTR lpItemName,
|
LPCWSTR lpItemName,
|
||||||
LPCWSTR lpArguments,
|
LPCWSTR lpArguments,
|
||||||
LPCWSTR lpIconLocation,
|
LPCWSTR lpIconLocation,
|
||||||
|
@ -164,7 +164,7 @@ AddDesktopItemW (BOOL bCommonItem,
|
||||||
|
|
||||||
bResult = FALSE;
|
bResult = FALSE;
|
||||||
|
|
||||||
if (!GetDesktopPath (bCommonItem, szLinkPath))
|
if (!GetDesktopPath (bCommonDesktop, szLinkPath))
|
||||||
{
|
{
|
||||||
DPRINT1 ("GetDesktopPath() failed\n");
|
DPRINT1 ("GetDesktopPath() failed\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -383,4 +383,68 @@ DeleteGroupW (LPCWSTR lpGroupName,
|
||||||
return TRUE;
|
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 */
|
/* EOF */
|
||||||
|
|
|
@ -5,6 +5,8 @@ CreateGroupA@8 @101 NONAME
|
||||||
CreateGroupW@8 @102 NONAME
|
CreateGroupW@8 @102 NONAME
|
||||||
DeleteGroupA@8 @103 NONAME
|
DeleteGroupA@8 @103 NONAME
|
||||||
DeleteGroupW@8 @104 NONAME
|
DeleteGroupW@8 @104 NONAME
|
||||||
|
DeleteItemA@16 @107 NONAME
|
||||||
|
DeleteItemW@16 @108 NONAME
|
||||||
CreateUserProfileA@8 @109 NONAME
|
CreateUserProfileA@8 @109 NONAME
|
||||||
CreateUserProfileW@8 @110 NONAME
|
CreateUserProfileW@8 @110 NONAME
|
||||||
AddDesktopItemA@32 @113 NONAME
|
AddDesktopItemA@32 @113 NONAME
|
||||||
|
|
|
@ -5,6 +5,8 @@ CreateGroupA=CreateGroupA@8 @101 NONAME
|
||||||
CreateGroupW=CreateGroupW@8 @102 NONAME
|
CreateGroupW=CreateGroupW@8 @102 NONAME
|
||||||
DeleteGroupA=DeleteGroupA@8 @103 NONAME
|
DeleteGroupA=DeleteGroupA@8 @103 NONAME
|
||||||
DeleteGroupW=DeleteGroupW@8 @104 NONAME
|
DeleteGroupW=DeleteGroupW@8 @104 NONAME
|
||||||
|
DeleteItemA=DeleteItemA@16 @107 NONAME
|
||||||
|
DeleteItemW=DeleteItemW@16 @108 NONAME
|
||||||
CreateUserProfileA=CreateUserProfileA@8 @109 NONAME
|
CreateUserProfileA=CreateUserProfileA@8 @109 NONAME
|
||||||
CreateUserProfileW=CreateUserProfileW@8 @110 NONAME
|
CreateUserProfileW=CreateUserProfileW@8 @110 NONAME
|
||||||
AddDesktopItemA=AddDesktopItemA@32 @113 NONAME
|
AddDesktopItemA=AddDesktopItemA@32 @113 NONAME
|
||||||
|
|
|
@ -48,6 +48,8 @@ BOOL WINAPI CreateGroupA (LPCSTR, BOOL);
|
||||||
BOOL WINAPI CreateGroupW (LPCWSTR, BOOL);
|
BOOL WINAPI CreateGroupW (LPCWSTR, BOOL);
|
||||||
BOOL WINAPI DeleteGroupA (LPCSTR, BOOL);
|
BOOL WINAPI DeleteGroupA (LPCSTR, BOOL);
|
||||||
BOOL WINAPI DeleteGroupW (LPCWSTR, BOOL);
|
BOOL WINAPI DeleteGroupW (LPCWSTR, BOOL);
|
||||||
|
BOOL WINAPI DeleteItemA (LPCSTR, BOOL, LPCSTR, BOOL);
|
||||||
|
BOOL WINAPI DeleteItemW (LPCWSTR, BOOL, LPCWSTR, BOOL);
|
||||||
/* end private */
|
/* end private */
|
||||||
BOOL WINAPI LoadUserProfileA (HANDLE, LPPROFILEINFOA);
|
BOOL WINAPI LoadUserProfileA (HANDLE, LPPROFILEINFOA);
|
||||||
BOOL WINAPI LoadUserProfileW (HANDLE, LPPROFILEINFOW);
|
BOOL WINAPI LoadUserProfileW (HANDLE, LPPROFILEINFOW);
|
||||||
|
@ -74,6 +76,7 @@ typedef LPPROFILEINFOW LPPROFILEINFO;
|
||||||
#define DeleteDesktopItem DeleteDesktopItemW
|
#define DeleteDesktopItem DeleteDesktopItemW
|
||||||
#define CreateGroup CreateGroupW
|
#define CreateGroup CreateGroupW
|
||||||
#define DeleteGroup DeleteGroupW
|
#define DeleteGroup DeleteGroupW
|
||||||
|
#define DeleteItem DeleteItemW
|
||||||
/* end private */
|
/* end private */
|
||||||
#define LoadUserProfile LoadUserProfileW
|
#define LoadUserProfile LoadUserProfileW
|
||||||
#define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryW
|
#define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryW
|
||||||
|
@ -89,6 +92,7 @@ typedef LPPROFILEINFOA LPPROFILEINFO;
|
||||||
#define DeleteDesktopItem DeleteDesktopItemA
|
#define DeleteDesktopItem DeleteDesktopItemA
|
||||||
#define CreateGroup CreateGroupA
|
#define CreateGroup CreateGroupA
|
||||||
#define DeleteGroup DeleteGroupA
|
#define DeleteGroup DeleteGroupA
|
||||||
|
#define DeleteItem DeleteItemA
|
||||||
/* end private */
|
/* end private */
|
||||||
#define LoadUserProfile LoadUserProfileA
|
#define LoadUserProfile LoadUserProfileA
|
||||||
#define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryA
|
#define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryA
|
||||||
|
|
Loading…
Reference in a new issue