mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Enable the creation of nested desktop and start menu groups.
svn path=/trunk/; revision=9318
This commit is contained in:
parent
60676825a8
commit
83d8ef34bb
3 changed files with 91 additions and 17 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: desktop.c,v 1.5 2004/05/05 15:29:15 ekohl Exp $
|
||||
/* $Id: desktop.c,v 1.6 2004/05/07 11:18:53 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -178,15 +178,15 @@ AddDesktopItemW (BOOL bCommonDesktop,
|
|||
&FindData);
|
||||
if (hFind == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DPRINT1 ("'%S' does not exist\n", szLinkPath);
|
||||
DPRINT ("'%S' does not exist\n", szLinkPath);
|
||||
|
||||
/* FIXME: create directory path */
|
||||
if (!CreateDirectoryW (szLinkPath, NULL))
|
||||
/* Create directory path */
|
||||
if (!CreateDirectoryPath (szLinkPath, NULL))
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1 ("'%S' exists\n", szLinkPath);
|
||||
DPRINT ("'%S' exists\n", szLinkPath);
|
||||
FindClose (hFind);
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ CreateGroupW (LPCWSTR lpGroupName,
|
|||
{
|
||||
WCHAR szGroupPath[MAX_PATH];
|
||||
|
||||
DPRINT ("CreateGroupW() called\n");
|
||||
DPRINT1 ("CreateGroupW() called\n");
|
||||
|
||||
if (lpGroupName == NULL || *lpGroupName == 0)
|
||||
return TRUE;
|
||||
|
@ -340,19 +340,19 @@ CreateGroupW (LPCWSTR lpGroupName,
|
|||
DPRINT1 ("GetProgramsPath() failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
DPRINT ("Programs path: '%S'\n", szGroupPath);
|
||||
DPRINT1 ("Programs path: '%S'\n", szGroupPath);
|
||||
|
||||
wcscat (szGroupPath, L"\\");
|
||||
wcscat (szGroupPath, lpGroupName);
|
||||
DPRINT ("Group path: '%S'\n", szGroupPath);
|
||||
DPRINT1 ("Group path: '%S'\n", szGroupPath);
|
||||
|
||||
/* FIXME: Create directory path */
|
||||
if (!CreateDirectoryW (szGroupPath, NULL))
|
||||
/* Create directory path */
|
||||
if (!CreateDirectoryPath (szGroupPath, NULL))
|
||||
return FALSE;
|
||||
|
||||
/* FIXME: Notify the shell */
|
||||
|
||||
DPRINT ("CreateGroupW() done\n");
|
||||
DPRINT1 ("CreateGroupW() done\n");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -389,8 +389,8 @@ DeleteGroupW (LPCWSTR lpGroupName,
|
|||
wcscat (szGroupPath, lpGroupName);
|
||||
DPRINT ("Group path: '%S'\n", szGroupPath);
|
||||
|
||||
/* FIXME: Remove directory path */
|
||||
if (!RemoveDirectoryW (szGroupPath))
|
||||
/* Remove directory path */
|
||||
if (!RemoveDirectoryPath (szGroupPath))
|
||||
return FALSE;
|
||||
|
||||
/* FIXME: Notify the shell */
|
||||
|
@ -440,7 +440,7 @@ AddItemW (LPCWSTR lpGroupName,
|
|||
HRESULT hr;
|
||||
BOOL bResult;
|
||||
|
||||
DPRINT ("AddDesktopItemW() called\n");
|
||||
DPRINT ("AddItemW() called\n");
|
||||
|
||||
bResult = FALSE;
|
||||
|
||||
|
@ -560,7 +560,7 @@ AddItemW (LPCWSTR lpGroupName,
|
|||
|
||||
CoUninitialize();
|
||||
|
||||
DPRINT ("AddDesktopItemW() done\n");
|
||||
DPRINT ("AddItemW() done\n");
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: directory.c,v 1.2 2004/01/16 15:31:53 ekohl Exp $
|
||||
/* $Id: directory.c,v 1.3 2004/05/07 11:18:53 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -116,4 +116,71 @@ CopyDirectory (LPCWSTR lpDestinationPath,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
CreateDirectoryPath (LPCWSTR lpPathName,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes)
|
||||
{
|
||||
WCHAR szPath[MAX_PATH];
|
||||
LPWSTR Ptr;
|
||||
DWORD dwError;
|
||||
|
||||
DPRINT ("CreateDirectoryPath() called\n");
|
||||
|
||||
if (lpPathName == NULL || *lpPathName == 0)
|
||||
return TRUE;
|
||||
|
||||
if (CreateDirectoryW (lpPathName,
|
||||
lpSecurityAttributes))
|
||||
return TRUE;
|
||||
|
||||
dwError = GetLastError ();
|
||||
if (dwError == ERROR_ALREADY_EXISTS)
|
||||
return TRUE;
|
||||
|
||||
wcscpy (szPath, lpPathName);
|
||||
|
||||
if (wcslen(szPath) > 3 && szPath[1] == ':' && szPath[2] == '\\')
|
||||
{
|
||||
Ptr = &szPath[3];
|
||||
}
|
||||
else
|
||||
{
|
||||
Ptr = szPath;
|
||||
}
|
||||
|
||||
while (Ptr != NULL)
|
||||
{
|
||||
Ptr = wcschr (Ptr, L'\\');
|
||||
if (Ptr != NULL)
|
||||
*Ptr = 0;
|
||||
|
||||
DPRINT ("CreateDirectory(%S)\n", szPath);
|
||||
if (!CreateDirectoryW (szPath,
|
||||
lpSecurityAttributes))
|
||||
{
|
||||
dwError = GetLastError ();
|
||||
if (dwError != ERROR_ALREADY_EXISTS)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (Ptr != NULL)
|
||||
{
|
||||
*Ptr = L'\\';
|
||||
Ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
DPRINT ("CreateDirectoryPath() done\n");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
RemoveDirectoryPath (LPCWSTR lpPathName)
|
||||
{
|
||||
return RemoveDirectoryW (lpPathName);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: internal.h,v 1.5 2004/03/13 20:49:07 ekohl Exp $
|
||||
/* $Id: internal.h,v 1.6 2004/05/07 11:18:53 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
|
@ -29,6 +29,13 @@ BOOL
|
|||
CopyDirectory (LPCWSTR lpDestinationPath,
|
||||
LPCWSTR lpSourcePath);
|
||||
|
||||
BOOL
|
||||
CreateDirectoryPath (LPCWSTR lpPathName,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes);
|
||||
|
||||
BOOL
|
||||
RemoveDirectoryPath (LPCWSTR lpPathName);
|
||||
|
||||
/* misc.c */
|
||||
LPWSTR
|
||||
AppendBackslash (LPWSTR String);
|
||||
|
|
Loading…
Reference in a new issue