mirror of
https://github.com/reactos/reactos.git
synced 2025-04-18 19:47:14 +00:00
- Implement DeleteGroup().
- Implement ANSI profile directory functions. svn path=/trunk/; revision=9291
This commit is contained in:
parent
560afee25c
commit
03cfc7943a
5 changed files with 192 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: desktop.c,v 1.2 2004/05/01 11:55:01 ekohl Exp $
|
||||
/* $Id: desktop.c,v 1.3 2004/05/03 12:05:44 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -330,7 +330,7 @@ CreateGroupW (LPCWSTR lpGroupName,
|
|||
DPRINT ("Group path: '%S'\n", szGroupPath);
|
||||
|
||||
/* FIXME: Create nested directories */
|
||||
if (!CreateDirectory (szGroupPath, NULL))
|
||||
if (!CreateDirectoryW (szGroupPath, NULL))
|
||||
return FALSE;
|
||||
|
||||
/* FIXME: Notify the shell */
|
||||
|
@ -340,4 +340,47 @@ CreateGroupW (LPCWSTR lpGroupName,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BOOL WINAPI
|
||||
DeleteGroupA (LPCSTR lpGroupName,
|
||||
BOOL bCommonGroup)
|
||||
{
|
||||
DPRINT1 ("DeleteGroupA() not implemented!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
BOOL WINAPI
|
||||
DeleteGroupW (LPCWSTR lpGroupName,
|
||||
BOOL bCommonGroup)
|
||||
{
|
||||
WCHAR szGroupPath[MAX_PATH];
|
||||
|
||||
DPRINT ("DeleteGroupW() called\n");
|
||||
|
||||
if (lpGroupName == NULL || *lpGroupName == 0)
|
||||
return TRUE;
|
||||
|
||||
if (!GetProgramsPath (bCommonGroup, szGroupPath))
|
||||
{
|
||||
DPRINT1 ("GetProgramsPath() failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
DPRINT ("Programs path: '%S'\n", szGroupPath);
|
||||
|
||||
wcscat (szGroupPath, L"\\");
|
||||
wcscat (szGroupPath, lpGroupName);
|
||||
DPRINT ("Group path: '%S'\n", szGroupPath);
|
||||
|
||||
/* FIXME: Remove nested directories */
|
||||
if (!RemoveDirectoryW (szGroupPath))
|
||||
return FALSE;
|
||||
|
||||
/* FIXME: Notify the shell */
|
||||
|
||||
DPRINT ("DeleteGroupW() done\n");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: profile.c,v 1.10 2004/04/29 14:41:26 ekohl Exp $
|
||||
/* $Id: profile.c,v 1.11 2004/05/03 12:05:44 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -301,6 +301,38 @@ CreateUserProfileW (PSID Sid,
|
|||
}
|
||||
|
||||
|
||||
BOOL WINAPI
|
||||
GetAllUsersProfileDirectoryA (LPSTR lpProfileDir,
|
||||
LPDWORD lpcchSize)
|
||||
{
|
||||
LPWSTR lpBuffer;
|
||||
BOOL bResult;
|
||||
|
||||
lpBuffer = GlobalAlloc (GMEM_FIXED,
|
||||
*lpcchSize * sizeof(WCHAR));
|
||||
if (lpBuffer == NULL)
|
||||
return FALSE;
|
||||
|
||||
bResult = GetAllUsersProfileDirectoryW (lpBuffer,
|
||||
lpcchSize);
|
||||
if (bResult)
|
||||
{
|
||||
WideCharToMultiByte (CP_ACP,
|
||||
0,
|
||||
lpBuffer,
|
||||
-1,
|
||||
lpProfileDir,
|
||||
*lpcchSize,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
|
||||
GlobalFree (lpBuffer);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
BOOL WINAPI
|
||||
GetAllUsersProfileDirectoryW (LPWSTR lpProfileDir,
|
||||
LPDWORD lpcchSize)
|
||||
|
@ -382,6 +414,38 @@ GetAllUsersProfileDirectoryW (LPWSTR lpProfileDir,
|
|||
}
|
||||
|
||||
|
||||
BOOL WINAPI
|
||||
GetDefaultUserProfileDirectoryA (LPSTR lpProfileDir,
|
||||
LPDWORD lpcchSize)
|
||||
{
|
||||
LPWSTR lpBuffer;
|
||||
BOOL bResult;
|
||||
|
||||
lpBuffer = GlobalAlloc (GMEM_FIXED,
|
||||
*lpcchSize * sizeof(WCHAR));
|
||||
if (lpBuffer == NULL)
|
||||
return FALSE;
|
||||
|
||||
bResult = GetDefaultUserProfileDirectoryW (lpBuffer,
|
||||
lpcchSize);
|
||||
if (bResult)
|
||||
{
|
||||
WideCharToMultiByte (CP_ACP,
|
||||
0,
|
||||
lpBuffer,
|
||||
-1,
|
||||
lpProfileDir,
|
||||
*lpcchSize,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
|
||||
GlobalFree (lpBuffer);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
BOOL WINAPI
|
||||
GetDefaultUserProfileDirectoryW (LPWSTR lpProfileDir,
|
||||
LPDWORD lpcchSize)
|
||||
|
@ -463,6 +527,38 @@ GetDefaultUserProfileDirectoryW (LPWSTR lpProfileDir,
|
|||
}
|
||||
|
||||
|
||||
BOOL WINAPI
|
||||
GetProfilesDirectoryA (LPSTR lpProfileDir,
|
||||
LPDWORD lpcchSize)
|
||||
{
|
||||
LPWSTR lpBuffer;
|
||||
BOOL bResult;
|
||||
|
||||
lpBuffer = GlobalAlloc (GMEM_FIXED,
|
||||
*lpcchSize * sizeof(WCHAR));
|
||||
if (lpBuffer == NULL)
|
||||
return FALSE;
|
||||
|
||||
bResult = GetProfilesDirectoryW (lpBuffer,
|
||||
lpcchSize);
|
||||
if (bResult)
|
||||
{
|
||||
WideCharToMultiByte (CP_ACP,
|
||||
0,
|
||||
lpBuffer,
|
||||
-1,
|
||||
lpProfileDir,
|
||||
*lpcchSize,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
|
||||
GlobalFree (lpBuffer);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
BOOL WINAPI
|
||||
GetProfilesDirectoryW (LPWSTR lpProfilesDir,
|
||||
LPDWORD lpcchSize)
|
||||
|
@ -526,6 +622,40 @@ GetProfilesDirectoryW (LPWSTR lpProfilesDir,
|
|||
}
|
||||
|
||||
|
||||
BOOL WINAPI
|
||||
GetUserProfileDirectoryA (HANDLE hToken,
|
||||
LPSTR lpProfileDir,
|
||||
LPDWORD lpcchSize)
|
||||
{
|
||||
LPWSTR lpBuffer;
|
||||
BOOL bResult;
|
||||
|
||||
lpBuffer = GlobalAlloc (GMEM_FIXED,
|
||||
*lpcchSize * sizeof(WCHAR));
|
||||
if (lpBuffer == NULL)
|
||||
return FALSE;
|
||||
|
||||
bResult = GetUserProfileDirectoryW (hToken,
|
||||
lpBuffer,
|
||||
lpcchSize);
|
||||
if (bResult)
|
||||
{
|
||||
WideCharToMultiByte (CP_ACP,
|
||||
0,
|
||||
lpBuffer,
|
||||
-1,
|
||||
lpProfileDir,
|
||||
*lpcchSize,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
|
||||
GlobalFree (lpBuffer);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
BOOL WINAPI
|
||||
GetUserProfileDirectoryW (HANDLE hToken,
|
||||
LPWSTR lpProfileDir,
|
||||
|
|
|
@ -3,6 +3,8 @@ EXPORTS
|
|||
InitializeProfiles@0 @100 NONAME
|
||||
CreateGroupA@8 @101 NONAME
|
||||
CreateGroupW@8 @102 NONAME
|
||||
DeleteGroupA@8 @103 NONAME
|
||||
DeleteGroupW@8 @104 NONAME
|
||||
CreateUserProfileA@8 @109 NONAME
|
||||
CreateUserProfileW@8 @110 NONAME
|
||||
AddDesktopItemA@32 @113 NONAME
|
||||
|
@ -11,9 +13,13 @@ DeleteDesktopItemA@8 @115 NONAME
|
|||
DeleteDesktopItemW@8 @116 NONAME
|
||||
CreateEnvironmentBlock@12
|
||||
DestroyEnvironmentBlock@4
|
||||
GetAllUsersProfileDirectoryA@8
|
||||
GetAllUsersProfileDirectoryW@8
|
||||
GetDefaultUserProfileDirectoryA@8
|
||||
GetDefaultUserProfileDirectoryW@8
|
||||
GetProfilesDirectoryA@8
|
||||
GetProfilesDirectoryW@8
|
||||
GetUserProfileDirectoryA@12
|
||||
GetUserProfileDirectoryW@12
|
||||
LoadUserProfileA@8
|
||||
LoadUserProfileW@8
|
||||
|
|
|
@ -3,6 +3,8 @@ EXPORTS
|
|||
InitializeProfiles=InitializeProfiles@0 @100 NONAME
|
||||
CreateGroupA=CreateGroupA@8 @101 NONAME
|
||||
CreateGroupW=CreateGroupW@8 @102 NONAME
|
||||
DeleteGroupA=DeleteGroupA@8 @103 NONAME
|
||||
DeleteGroupW=DeleteGroupW@8 @104 NONAME
|
||||
CreateUserProfileA=CreateUserProfileA@8 @109 NONAME
|
||||
CreateUserProfileW=CreateUserProfileW@8 @110 NONAME
|
||||
AddDesktopItemA=AddDesktopItemA@32 @113 NONAME
|
||||
|
@ -11,9 +13,13 @@ DeleteDesktopItemA=DeleteDesktopItemA@8 @115 NONAME
|
|||
DeleteDesktopItemW=DeleteDesktopItemW@8 @116 NONAME
|
||||
CreateEnvironmentBlock=CreateEnvironmentBlock@12
|
||||
DestroyEnvironmentBlock=DestroyEnvironmentBlock@4
|
||||
GetAllUsersProfileDirectoryA=GetAllUsersProfileDirectoryA@8
|
||||
GetAllUsersProfileDirectoryW=GetAllUsersProfileDirectoryW@8
|
||||
GetDefaultUserProfileDirectoryA=GetDefaultUserProfileDirectoryA@8
|
||||
GetDefaultUserProfileDirectoryW=GetDefaultUserProfileDirectoryW@8
|
||||
GetProfilesDirectoryA=GetProfilesDirectoryA@8
|
||||
GetProfilesDirectoryW=GetProfilesDirectoryW@8
|
||||
GetUserProfileDirectoryA=GetUserProfileDirectoryA@12
|
||||
GetUserProfileDirectoryW=GetUserProfileDirectoryW@12
|
||||
LoadUserProfileA=LoadUserProfileA@8
|
||||
LoadUserProfileW=LoadUserProfileW@8
|
||||
|
|
|
@ -46,6 +46,8 @@ BOOL WINAPI DeleteDesktopItemA (BOOL, LPCSTR);
|
|||
BOOL WINAPI DeleteDesktopItemW (BOOL, LPCWSTR);
|
||||
BOOL WINAPI CreateGroupA (LPCSTR, BOOL);
|
||||
BOOL WINAPI CreateGroupW (LPCWSTR, BOOL);
|
||||
BOOL WINAPI DeleteGroupA (LPCSTR, BOOL);
|
||||
BOOL WINAPI DeleteGroupW (LPCWSTR, BOOL);
|
||||
/* end private */
|
||||
BOOL WINAPI LoadUserProfileA (HANDLE, LPPROFILEINFOA);
|
||||
BOOL WINAPI LoadUserProfileW (HANDLE, LPPROFILEINFOW);
|
||||
|
@ -71,6 +73,7 @@ typedef LPPROFILEINFOW LPPROFILEINFO;
|
|||
#define AddDesktopItem AddDesktopItemW
|
||||
#define DeleteDesktopItem DeleteDesktopItemW
|
||||
#define CreateGroup CreateGroupW
|
||||
#define DeleteGroup DeleteGroupW
|
||||
/* end private */
|
||||
#define LoadUserProfile LoadUserProfileW
|
||||
#define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryW
|
||||
|
@ -85,6 +88,7 @@ typedef LPPROFILEINFOA LPPROFILEINFO;
|
|||
#define AddDesktopItem AddDesktopItemA
|
||||
#define DeleteDesktopItem DeleteDesktopItemA
|
||||
#define CreateGroup CreateGroupA
|
||||
#define DeleteGroup DeleteGroupA
|
||||
/* end private */
|
||||
#define LoadUserProfile LoadUserProfileA
|
||||
#define GetAllUsersProfileDirectory GetAllUsersProfileDirectoryA
|
||||
|
|
Loading…
Reference in a new issue