Skip to content

Commit

Permalink
Merge pull request #1126 from dorssel/fix_detach
Browse files Browse the repository at this point in the history
Fix detach for interactive users
  • Loading branch information
dorssel authored Feb 1, 2025
2 parents 87eaf69 + 8d95d3b commit d52ae5f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Usbipd/RegistryUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ public static RegistryKey SetDeviceAsAttached(Guid guid, BusId busId, IPAddress
var registrySecurity = attached.GetAccessControl(AccessControlSections.All);
registrySecurity.AddAccessRule(new RegistryAccessRule(new SecurityIdentifier(WellKnownSidType.WinConsoleLogonSid, null),
RegistryRights.Delete, AccessControlType.Allow));
// Required for Windows 11 (WinConsoleLogonSid is not enough)
registrySecurity.AddAccessRule(new RegistryAccessRule(new SecurityIdentifier(WellKnownSidType.InteractiveSid, null),
RegistryRights.Delete, AccessControlType.Allow));
attached.SetAccessControl(registrySecurity);
try
{
Expand Down

0 comments on commit d52ae5f

Please sign in to comment.