mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:02:56 +00:00
Remove outdated profile path postfix.
svn path=/trunk/; revision=11199
This commit is contained in:
parent
528acaf7b3
commit
e48441fd2e
1 changed files with 3 additions and 18 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: profile.c,v 1.14 2004/10/03 09:27:22 ekohl Exp $
|
/* $Id: profile.c,v 1.15 2004/10/05 13:39:42 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
|
||||||
|
@ -35,10 +35,8 @@ AppendSystemPostfix (LPWSTR lpName,
|
||||||
DWORD dwMaxLength)
|
DWORD dwMaxLength)
|
||||||
{
|
{
|
||||||
WCHAR szSystemRoot[MAX_PATH];
|
WCHAR szSystemRoot[MAX_PATH];
|
||||||
WCHAR szDrivePostfix[3];
|
|
||||||
LPWSTR lpszPostfix;
|
LPWSTR lpszPostfix;
|
||||||
LPWSTR lpszPtr;
|
LPWSTR lpszPtr;
|
||||||
DWORD dwPostfixLength;
|
|
||||||
|
|
||||||
/* Build profile name postfix */
|
/* Build profile name postfix */
|
||||||
if (!ExpandEnvironmentStringsW (L"%SystemRoot%",
|
if (!ExpandEnvironmentStringsW (L"%SystemRoot%",
|
||||||
|
@ -62,26 +60,13 @@ AppendSystemPostfix (LPWSTR lpName,
|
||||||
lpszPtr++;
|
lpszPtr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
dwPostfixLength = wcslen (lpszPostfix);
|
if (wcslen(lpName) + wcslen(lpszPostfix) >= dwMaxLength)
|
||||||
if (szSystemRoot[0] != L'C')
|
|
||||||
{
|
|
||||||
dwPostfixLength += 2;
|
|
||||||
szDrivePostfix[0] = L'_';
|
|
||||||
szDrivePostfix[1] = szSystemRoot[0];
|
|
||||||
szDrivePostfix[2] = (WCHAR)0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wcslen (lpName) + dwPostfixLength >= dwMaxLength)
|
|
||||||
{
|
{
|
||||||
DPRINT1("Error: buffer overflow\n");
|
DPRINT1("Error: buffer overflow\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wcscat (lpName, lpszPostfix);
|
wcscat(lpName, lpszPostfix);
|
||||||
if (szSystemRoot[0] != L'C')
|
|
||||||
{
|
|
||||||
wcscat (lpName, szDrivePostfix);
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue