mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 15:34:13 +00:00
[USERENV] Add %HOMEDRIVE% and %HOMEPATH% environment variables. Brought to you by Radek Liška. CORE-9875
svn path=/trunk/; revision=68284
This commit is contained in:
parent
ea61881cf9
commit
78f1c4a361
|
@ -510,10 +510,30 @@ CreateEnvironmentBlock(LPVOID *lpEnvironment,
|
|||
Buffer,
|
||||
&Length))
|
||||
{
|
||||
DWORD MinLen = 2;
|
||||
|
||||
SetUserEnvironmentVariable(lpEnvironment,
|
||||
L"USERPROFILE",
|
||||
Buffer,
|
||||
FALSE);
|
||||
|
||||
/* At least <drive letter>:<path> */
|
||||
if (Length > MinLen)
|
||||
{
|
||||
/* Set 'HOMEDRIVE' variable */
|
||||
StringCchCopyNW(szValue, MAX_PATH, Buffer, MinLen);
|
||||
SetUserEnvironmentVariable(lpEnvironment,
|
||||
L"HOMEDRIVE",
|
||||
szValue,
|
||||
FALSE);
|
||||
|
||||
/* Set 'HOMEPATH' variable */
|
||||
StringCchCopyNW(szValue, MAX_PATH, Buffer + MinLen, Length - MinLen);
|
||||
SetUserEnvironmentVariable(lpEnvironment,
|
||||
L"HOMEPATH",
|
||||
szValue,
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
if (GetUserAndDomainName(hToken,
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#define NTOS_MODE_USER
|
||||
#include <ndk/rtlfuncs.h>
|
||||
#include <userenv.h>
|
||||
#include <strsafe.h>
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
|
|
Loading…
Reference in a new issue