Skip to content

Commit

Permalink
Fix viewing access for WinSta and desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
diversenok committed Aug 7, 2023
1 parent 5b01aad commit 32b7eb8
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions Core/TU.Access.pas
Original file line number Diff line number Diff line change
Expand Up @@ -542,18 +542,12 @@ function TuMakeSingletonOpener(
ltScmDatabase: Result := ScmxConnect(hxObject, DesiredAccess);

ltCurrentWinSta:
begin
hxObject := Auto.CaptureHandle(UsrxCurrentWindowStation);
hxObject.AutoRelease := False;
Result.Status := STATUS_SUCCESS;
end;
Result := NtxDuplicateHandleLocal(UsrxCurrentWindowStation, hxObject,
DesiredAccess);

ltCurrentDesktop:
begin
hxObject := Auto.CaptureHandle(UsrxCurrentDesktop);
hxObject.AutoRelease := False;
Result.Status := STATUS_SUCCESS;
end
Result := NtxDuplicateHandleLocal(UsrxCurrentDesktop, hxObject,
DesiredAccess);
else
Result.Location := 'TuMakeSingletonOpener';
Result.Status := STATUS_INVALID_PARAMETER;
Expand Down

0 comments on commit 32b7eb8

Please sign in to comment.