mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
Replace a call to undocumented function CreateUserProfile by its documented equivalent (LogonUser + LoadUserProfile)
In all cases, this code should be removed once NtUnloadKey is implemented Add a message to remind when to remove this hack svn path=/trunk/; revision=28244
This commit is contained in:
parent
583043c3b0
commit
e1fb5a56a5
1 changed files with 30 additions and 9 deletions
|
@ -722,18 +722,39 @@ InstallReactOS(HINSTANCE hInstance)
|
|||
}
|
||||
}
|
||||
|
||||
/* Create the Administrator profile */
|
||||
if (!CreateUserProfileW(AdminSid, L"Administrator"))
|
||||
{
|
||||
DebugPrint("CreateUserProfileW() failed!");
|
||||
RtlFreeSid(AdminSid);
|
||||
RtlFreeSid(DomainSid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
RtlFreeSid(AdminSid);
|
||||
RtlFreeSid(DomainSid);
|
||||
|
||||
/* ROS HACK, as long as NtUnloadKey is not implemented */
|
||||
{
|
||||
NTSTATUS Status = NtUnloadKey(NULL);
|
||||
if (Status == STATUS_NOT_IMPLEMENTED)
|
||||
{
|
||||
/* Create the Administrator profile */
|
||||
PROFILEINFOW ProfileInfo;
|
||||
HANDLE hToken;
|
||||
BOOL ret;
|
||||
#define LOGON32_LOGON_NETWORK 3
|
||||
ret = LogonUserW(L"Administrator", L"", L"", LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, &hToken);
|
||||
if (!ret)
|
||||
{
|
||||
DebugPrint("LogonUserW() failed!");
|
||||
return 0;
|
||||
}
|
||||
ZeroMemory(&ProfileInfo, sizeof(PROFILEINFOW));
|
||||
ProfileInfo.dwSize = sizeof(PROFILEINFOW);
|
||||
ProfileInfo.lpUserName = L"Administrator";
|
||||
ProfileInfo.dwFlags = PI_NOUI;
|
||||
LoadUserProfileW(hToken, &ProfileInfo);
|
||||
CloseHandle(hToken);
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1("ROS HACK not needed anymore. Please remove it\n");
|
||||
}
|
||||
}
|
||||
/* END OF ROS HACK */
|
||||
|
||||
CreateTempDir(L"TEMP");
|
||||
CreateTempDir(L"TMP");
|
||||
|
||||
|
|
Loading…
Reference in a new issue