Windows Explorer crashes on right-click when NextcloudContextMenuHandler is enabled
- Dominant language
- C++
- Stars
- 3.9k
- Forks
- 1k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 123
Description
### Bug description
Windows Explorer crashes whenever I right-click in Explorer while the Nextcloud shell context menu handler is enabled.
The issue is ongoing and happens on any right-click in Windows Explorer, regardless of location or selected item. Disabling only the `NextcloudContextMenuHandler` with Microsoft Sysinternals Autoruns immediately fixes the crashes. Re-enabling the handler makes the problem reproducible again.
### Steps to reproduce
1. Install / run Nextcloud Desktop Client on Windows.
2. Ensure the Nextcloud shell context menu handler is enabled:
- `NextcloudContextMenuHandler`
- CLSID: `{BC6988AB-ACE2-4B81-84DC-DC34F9B24401}`
- DLL: `C:\Program Files\Nextcloud\NCContextMenu.dll`
3. Open Windows Explorer.
4. Right-click any file, folder, background area, or location.
### Expected behavior
The Windows Explorer context menu opens normally.
### Actual behavior
Windows Explorer crashes/restarts.
Windows Event Viewer records an `APPCRASH` for `explorer.exe` with `SHELL32.dll` as the faulting module.
Relevant event details:
```text
Faulting application name: explorer.exe / Explorer.EXE
Faulting application version: 10.0.26100.8737
Faulting module name: SHELL32.dll
Faulting module version: 10.0.26100.8737
Exception code: 0xc0000005
Fault offset: 0x00000000000386af
Faulting application path: C:\WINDOWS\explorer.exe
Faulting module path: C:\WINDOWS\System32\SHELL32.dll
```
### Which files are affected by this bug
Any local file/folder/location in Windows Explorer. The crash is not specific to a synced Nextcloud file.
### Operating system
Windows
### Which version of the operating system you are running
Windows 25H2, build 26200.8737
Additional local file versions:
```text
C:\Windows\explorer.exe: 10.0.26100.8457
C:\Windows\System32\SHELL32.dll: 10.0.26100.8737
```
### Installation method
Official Windows MSI
### Nextcloud Server version
Nextcloud Hub 25 Autumn, 32.0.9, managed Hetzner hosting
### Nextcloud Desktop Client version
Nextcloud Desktop Client `33.0.7.20260629`
Installed app entry:
```text
DisplayName: Nextcloud
DisplayVersion: 33.0.7.20260629
Publisher: Nextcloud GmbH
InstallDate: 20260701
```
Affected shell extension file versions:
```text
C:\Program Files\Nextcloud\NCContextMenu.dll
FileVersion: 3,0,0,47
ProductVersion: 3,0,0,47
Company: Nextcloud GmbH
C:\Program Files\Nextcloud\NCOverlays.dll
FileVersion: 3,0,0,47
ProductVersion: 3,0,0,47
Company: Nextcloud GmbH
```
### Did this occur after an update or on a clean installation?
Minor version update / current latest client installation.
The local config directory contains previous MSI installers and config backups from older client versions, including 3.17.x, 4.0.x, and 33.0.x. Current installed version is `33.0.7.20260629`.
### Are you using the Nextcloud Server Encryption module?
No
### Are you using an external user-backend?
Unknown. This is managed Hetzner hosting. No LDAP/Active Directory or SSO/SAML backend is configured by me.
### Workaround
Disable `NextcloudContextMenuHandler` in Microsoft Sysinternals Autoruns:
```text
HKCR\AllFilesystemObjects\shellex\ContextMenuHandlers\NextcloudContextMenuHandler
(Default) = {BC6988AB-ACE2-4B81-84DC-DC34F9B24401}
HKCR\CLSID\{BC6988AB-ACE2-4B81-84DC-DC34F9B24401}\InprocServer32
(Default) = C:\Program Files\Nextcloud\NCContextMenu.dll
ThreadingModel = Apartment
```
After disabling that handler, Windows Explorer right-click works again.
### Additional info
The crash was reproduced multiple times and always had the same Event Viewer signature: `explorer.exe` crashing in `SHELL32.dll` with exception `0xc0000005` at offset `0x00000000000386af`.
No Nextcloud server logs are attached because this appears to be a local Windows shell extension crash before any server interaction.
Contributor guide
Research direction
Start by investigating the Windows shell-extension implementation that produces NCContextMenu.dll and reproduce the crash with NextcloudContextMenuHandler enabled. Compare behavior with the handler disabled and use the reported explorer.exe APPCRASH details to identify the fault; done means Explorer opens the context menu normally for all tested locations without crashing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100