Skip to content

Commit 8d95d3b

Browse files
committed
Fix detach for interactive users
1 parent 87eaf69 commit 8d95d3b

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)