[SETUPLIB][USETUP] Minor improvements.

- Use adequate access flag when opening symbolic links.
- Simplify the prototype of UpdateRegistry() since now both Setup INF
  handle and settings lists are inside the USETUP_DATA structure.
This commit is contained in:
Hermès Bélusca-Maïto 2018-01-07 01:35:48 +01:00
parent 13998a15c9
commit 1b0c26e21c
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
4 changed files with 16 additions and 27 deletions

View file

@ -616,7 +616,7 @@ ResolveArcNameNtSymLink(
DirectoryHandle,
NULL);
Status = NtOpenSymbolicLinkObject(&LinkHandle,
SYMBOLIC_LINK_ALL_ACCESS,
SYMBOLIC_LINK_QUERY,
&ObjectAttributes);
/* Close the \ArcName object directory handle */
@ -632,8 +632,9 @@ ResolveArcNameNtSymLink(
/* Reserve one WCHAR for the NULL-termination */
NtName->MaximumLength -= sizeof(UNICODE_NULL);
/* Resolve the link */
/* Resolve the link and close its handle */
Status = NtQuerySymbolicLinkObject(LinkHandle, NtName, NULL);
NtClose(LinkHandle);
/* Restore the NULL-termination */
NtName->MaximumLength += sizeof(UNICODE_NULL);
@ -650,7 +651,6 @@ ResolveArcNameNtSymLink(
NtName->Buffer[NtName->Length / sizeof(WCHAR)] = UNICODE_NULL;
}
NtClose(LinkHandle);
return Status;
}