mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[SYSSETUP] Open the security settings inf file only once in order to apply the settings
This commit is contained in:
parent
6e4e772e6c
commit
67e45c41ee
1 changed files with 29 additions and 35 deletions
|
@ -271,9 +271,9 @@ InstallBuiltinAccounts(VOID)
|
|||
|
||||
static
|
||||
VOID
|
||||
InstallPrivileges(VOID)
|
||||
InstallPrivileges(
|
||||
HINF hSecurityInf)
|
||||
{
|
||||
HINF hSecurityInf = INVALID_HANDLE_VALUE;
|
||||
LSA_OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
WCHAR szPrivilegeString[256];
|
||||
WCHAR szSidString[256];
|
||||
|
@ -287,16 +287,6 @@ InstallPrivileges(VOID)
|
|||
|
||||
DPRINT("InstallPrivileges()\n");
|
||||
|
||||
hSecurityInf = SetupOpenInfFileW(L"defltws.inf", //szNameBuffer,
|
||||
NULL,
|
||||
INF_STYLE_WIN4,
|
||||
NULL);
|
||||
if (hSecurityInf == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DPRINT1("SetupOpenInfFileW failed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
memset(&ObjectAttributes, 0, sizeof(LSA_OBJECT_ATTRIBUTES));
|
||||
|
||||
Status = LsaOpenPolicy(NULL,
|
||||
|
@ -394,17 +384,14 @@ InstallPrivileges(VOID)
|
|||
done:
|
||||
if (PolicyHandle != NULL)
|
||||
LsaClose(PolicyHandle);
|
||||
|
||||
if (hSecurityInf != INVALID_HANDLE_VALUE)
|
||||
SetupCloseInfFile(hSecurityInf);
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
VOID
|
||||
ApplyRegistryValues(VOID)
|
||||
ApplyRegistryValues(
|
||||
HINF hSecurityInf)
|
||||
{
|
||||
HINF hSecurityInf = INVALID_HANDLE_VALUE;
|
||||
WCHAR szRegistryPath[MAX_PATH];
|
||||
WCHAR szRootName[MAX_PATH];
|
||||
WCHAR szKeyName[MAX_PATH];
|
||||
|
@ -418,23 +405,13 @@ ApplyRegistryValues(VOID)
|
|||
|
||||
DPRINT("ApplyRegistryValues()\n");
|
||||
|
||||
hSecurityInf = SetupOpenInfFileW(L"defltws.inf", //szNameBuffer,
|
||||
NULL,
|
||||
INF_STYLE_WIN4,
|
||||
NULL);
|
||||
if (hSecurityInf == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DPRINT1("SetupOpenInfFileW failed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SetupFindFirstLineW(hSecurityInf,
|
||||
L"Registry Values",
|
||||
NULL,
|
||||
&InfContext))
|
||||
{
|
||||
DPRINT1("SetupFindFirstLineW failed\n");
|
||||
goto done;
|
||||
return;
|
||||
}
|
||||
|
||||
do
|
||||
|
@ -447,7 +424,7 @@ ApplyRegistryValues(VOID)
|
|||
NULL))
|
||||
{
|
||||
DPRINT1("SetupGetStringFieldW() failed\n");
|
||||
goto done;
|
||||
return;
|
||||
}
|
||||
|
||||
DPRINT("RegistryPath: %S\n", szRegistryPath);
|
||||
|
@ -606,19 +583,36 @@ ApplyRegistryValues(VOID)
|
|||
}
|
||||
}
|
||||
while (SetupFindNextLine(&InfContext, &InfContext));
|
||||
|
||||
done:
|
||||
if (hSecurityInf != INVALID_HANDLE_VALUE)
|
||||
SetupCloseInfFile(hSecurityInf);
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
InstallSecurity(VOID)
|
||||
{
|
||||
HINF hSecurityInf = INVALID_HANDLE_VALUE;
|
||||
PWSTR pszSecurityInf;
|
||||
|
||||
// if (IsServer())
|
||||
// pszSecurityInf = L"defltsv.inf";
|
||||
// else
|
||||
pszSecurityInf = L"defltws.inf";
|
||||
|
||||
InstallBuiltinAccounts();
|
||||
InstallPrivileges();
|
||||
ApplyRegistryValues();
|
||||
|
||||
hSecurityInf = SetupOpenInfFileW(pszSecurityInf,
|
||||
NULL,
|
||||
INF_STYLE_WIN4,
|
||||
NULL);
|
||||
if (hSecurityInf == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DPRINT1("SetupOpenInfFileW failed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
InstallPrivileges(hSecurityInf);
|
||||
ApplyRegistryValues(hSecurityInf);
|
||||
|
||||
SetupCloseInfFile(hSecurityInf);
|
||||
|
||||
/* Hack */
|
||||
SetPrimaryDomain(L"WORKGROUP", NULL);
|
||||
|
|
Loading…
Reference in a new issue