Skip to content

Commit d52ae5f

Browse files
authored
Merge pull request #1126 from dorssel/fix_detach
Fix detach for interactive users
2 parents 87eaf69 + 8d95d3b commit d52ae5f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Usbipd/RegistryUtilities.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ public static RegistryKey SetDeviceAsAttached(Guid guid, BusId busId, IPAddress
103103
var registrySecurity = attached.GetAccessControl(AccessControlSections.All);
104104
registrySecurity.AddAccessRule(new RegistryAccessRule(new SecurityIdentifier(WellKnownSidType.WinConsoleLogonSid, null),
105105
RegistryRights.Delete, AccessControlType.Allow));
106+
// Required for Windows 11 (WinConsoleLogonSid is not enough)
107+
registrySecurity.AddAccessRule(new RegistryAccessRule(new SecurityIdentifier(WellKnownSidType.InteractiveSid, null),
108+
RegistryRights.Delete, AccessControlType.Allow));
106109
attached.SetAccessControl(registrySecurity);
107110
try
108111
{

0 commit comments

Comments
 (0)