Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CopyAsTextCommand report an error!! #1290

Closed
mengxin523 opened this issue Jan 25, 2024 · 12 comments · Fixed by #1292
Closed

CopyAsTextCommand report an error!! #1290

mengxin523 opened this issue Jan 25, 2024 · 12 comments · Fixed by #1292
Assignees
Labels
bug Something isn't working no-repro Cannot reproduce released Available in a released installer
Milestone

Comments

@mengxin523
Copy link

ShareX-2024-01-25 17-26-47 1067

17| hashtag service scanned 3437 pages, updating 0, in 162050ms
10| hashtag service scanned 3437 pages, updating 0, in 162083ms
16| hashtag service scanned 3437 pages, updating 0, in 162013ms
16| hashtag service scanned 3437 pages, updating 0, in 162174ms
18| Running command SettingsCommand
10| Running command AboutCommand
03| hashtag service scanned 3437 pages, updating 0, in 162096ms
18| hashtag service scanned 3437 pages, updating 0, in 161965ms
14| hashtag service scanned 3437 pages, updating 0, in 161810ms
15| Running command CopyAsTextCommand
07| 运行命令CopyAsTextCommand时出错
07| System.Runtime.InteropServices.COMException
Message: OpenClipboard 失败 (异常来自 HRESULT:0x800401D0 (CLIPBRD_E_CANT_OPEN))
Description: Unrecognized error code 0x800401D0
ErrorCode: 0x800401D0 (-2147221040)
HResult: 0x800401D0 (-2147221040)
Source: mscorlib
StackTrace: 在 System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
在 System.Windows.Clipboard.Flush()
在 System.Windows.Clipboard.CriticalSetDataObject(Object data, Boolean copy)
在 System.Windows.Clipboard.SetDataInternal(String format, Object data)
在 River.OneMoreAddIn.ClipboardProvider.<>c__DisplayClass15_0.b__0()
在 River.OneMoreAddIn.SingleThreaded.<>c__DisplayClass1_0.b__0()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.GetResult()
在 River.OneMoreAddIn.ClipboardProvider.d__15.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.GetResult()
在 River.OneMoreAddIn.Commands.CopyAsTextCommand.d__1.MoveNext()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.GetResult()
在 River.OneMoreAddIn.CommandFactory.d__5.MoveNext()
TargetSite: [mscorlib] System.Runtime.InteropServices.Marshal::ThrowExceptionForHRInternal()

OneNote2024
OneMore6.1
ShareX-2024-01-25 17-28-14 1069

@mengxin523 mengxin523 added bug Something isn't working unread I have seen it or had time to refine it yet labels Jan 25, 2024
@ningdu0
Copy link

ningdu0 commented Jan 25, 2024

You can try to fix it in two ways:
1.open Local Security Policy ;
navigate to Security Settings > Local Policies > Security Options > System cryptography: Use FIPS compliant algorithms for encryption, hashing, and signing ;
Disable it

2.open regedit ;
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy ;
change both values "Enabled" and "MDMEnabled" to 0

@mengxin523
Copy link
Author

You can try to fix it in two ways: 1.open Local Security Policy ; navigate to Security Settings > Local Policies > Security Options > System cryptography: Use FIPS compliant algorithms for encryption, hashing, and signing ; Disable it

2.open regedit ; Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy ; change both values "Enabled" and "MDMEnabled" to 0

Very feel your reply, I just logged in to the system to see, the option on the local security policy was originally disabled, and the value in the registry was originally 0, but the problem still exists,I even restart the system
ShareX-2024-01-25 19-44-37 1071
ShareX-2024-01-25 19-45-05 1072

@stevencohn
Copy link
Owner

@ningdu0 FIPs only affects TLS validation. This is a problem accessing the clipboard. Other users have seen this in the past.

@mengxin523 Do you have any other utilities running that monitor or watch the clipboard?

@stevencohn stevencohn removed the unread I have seen it or had time to refine it yet label Jan 25, 2024
@mengxin523
Copy link
Author

@ningdu0 FIPs only affects TLS validation. This is a problem accessing the clipboard. Other users have seen this in the past.

@mengxin523 Do you have any other utilities running that monitor or watch the clipboard?

No, everything was normal before, but I don't know why things suddenly have problems, I don't know whether it has something to do with my updated Office2024

@stevencohn stevencohn self-assigned this Jan 25, 2024
@stevencohn stevencohn added no-repro Cannot reproduce next-release Addressed but not yet released labels Jan 25, 2024
@stevencohn stevencohn linked a pull request Jan 25, 2024 that will close this issue
@stevencohn
Copy link
Owner

I realize this is marked as both next-release and no-repro. While I wasn't able to repro the issue, I added some extra error handling to at least make the error more obvious.

@mengxin523
Copy link
Author

I realize this is marked as both next-release and no-repro. While I wasn't able to repro the issue, I added some extra error handling to at least make the error more obvious.

Although it will report this error, in fact the copy function is normal and can be pasted elsewhere as text instead of pictures!! This means that there is no need to show this error.

@mengxin523
Copy link
Author

I know the problem is because I used Baidu Netdisk to synchronize data in real time, and Baidu Netdisk's synchronization space monitors the clipboard. If I turn off this option, the error will not be displayed!

Otherwise, although it will report an error, but it does not affect the use of the copy function.

@mengxin523
Copy link
Author

ShareX-2024-01-26 09-55-27 1073

@jasonjac2
Copy link

Just to add to this @stevencohn I disabled my clipboard watcher in my app, but the copy Link to Para is doing the same thing 9copying a plain text URI rateher than a formatted HTML link and I can make it happen to order on enabling and disabling the app: AutoHotkey

@stevencohn
Copy link
Owner

@jasonjac2
Copy link

Indeed - a couple of potential solutions. I like the - be patient and then tell the user which app is hogging the clipboard.

@stevencohn
Copy link
Owner

stevencohn commented Jan 31, 2024

Going try switching from System.Windows.Clipboard to System.Windows.Forms.Clipboard which provides retry out of the box.

Commit details here - 7dd8c4c

@stevencohn stevencohn added released Available in a released installer and removed next-release Addressed but not yet released labels Apr 25, 2024
@stevencohn stevencohn added this to the 6.2.1 milestone Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no-repro Cannot reproduce released Available in a released installer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants