https://bugs.winehq.org/show_bug.cgi?id=48521
Bug ID: 48521 Summary: StaxRip throes errors: Win32Exception (2.0.6.0) Invalid function System.ComponentModel.Win32Exception (0x80004005): Invalid function Product: Wine Version: 5.0 Hardware: x86 URL: https://github.com/staxrip/staxrip/releases OS: Linux Status: NEW Keywords: dotnet, download, source Severity: normal Priority: P2 Component: ntdll Assignee: wine-bugs@winehq.org Reporter: xerox.xerox2000x@gmail.com Distribution: Debian
Steps to reproduce:
Use Staging (workaround https://bugs.winehq.org/show_bug.cgi?id=45868) and do
- winetricks -q dotnet40 dotnet48 - Invoke like ''wine start /unix /home/louis/StaxRip.exe'' otherwise you run into https://bugs.winehq.org/show_bug.cgi?id=48503
Try open an avi, it`ll tell you to install AviSynth, let it complete, then try convert it; In the end an errormessage pops up:
Win32Exception (2.0.6.0)
Invalid function
System.ComponentModel.Win32Exception (0x80004005): Invalid function at StaxRip.PowerRequest.SuppressStandby() in D:\Projekte\VB\staxrip\General\General.vb:line 1532 at StaxRip.GlobalClass.ProcessJobs() in D:\Projekte\VB\staxrip\General\GlobalClass.vb:line 36
The source is available from github:
Public Class PowerRequest Private Shared CurrentPowerRequest As IntPtr
Shared Sub SuppressStandby() If CurrentPowerRequest <> IntPtr.Zero Then PowerClearRequest(CurrentPowerRequest, PowerRequestType.PowerRequestSystemRequired) CurrentPowerRequest = IntPtr.Zero End If
Dim pContext As POWER_REQUEST_CONTEXT pContext.Flags = &H1 'POWER_REQUEST_CONTEXT_SIMPLE_STRING pContext.Version = 0 'POWER_REQUEST_CONTEXT_VERSION pContext.SimpleReasonString = "Standby suppressed by StaxRip" 'shown when the command "powercfg -requests" is executed
CurrentPowerRequest = PowerCreateRequest(pContext)
If CurrentPowerRequest = IntPtr.Zero Then Dim err = Marshal.GetLastWin32Error() If err <> 0 Then Throw New Win32Exception(err) End If
Dim success = PowerSetRequest(CurrentPowerRequest, PowerRequestType.PowerRequestSystemRequired)
If Not success Then CurrentPowerRequest = IntPtr.Zero Dim err = Marshal.GetLastWin32Error() If err <> 0 Then Throw New Win32Exception(err) End If End Sub
Shared Sub EnableStandby() If CurrentPowerRequest <> IntPtr.Zero Then Dim success = PowerClearRequest(CurrentPowerRequest, PowerRequestType.PowerRequestSystemRequired)
If Not success Then CurrentPowerRequest = IntPtr.Zero Dim err = Marshal.GetLastWin32Error() If err <> 0 Then Throw New Win32Exception(err) Else CurrentPowerRequest = IntPtr.Zero End If End If End Sub
Enum PowerRequestType PowerRequestDisplayRequired PowerRequestSystemRequired PowerRequestAwayModeRequired PowerRequestExecutionRequired End Enum
<DllImport("kernel32.dll", SetLastError:=True)> Shared Function PowerCreateRequest(ByRef Context As POWER_REQUEST_CONTEXT) As IntPtr End Function
<DllImport("kernel32.dll", SetLastError:=True)> Shared Function PowerSetRequest(PowerRequestHandle As IntPtr, RequestType As PowerRequestType) As Boolean End Function
<DllImport("kernel32.dll", SetLastError:=True)> Shared Function PowerClearRequest(PowerRequestHandle As IntPtr, RequestType As PowerRequestType) As Boolean End Function
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> Structure POWER_REQUEST_CONTEXT Public Version As UInt32 Public Flags As UInt32 <MarshalAs(UnmanagedType.LPWStr)> Public SimpleReasonString As String End Structure End Class
Returning STATUS_SUCCESS for Nt{Create,Set,Clear}PowerRequest gets rid of the errors. AFAICT it should be pretty safe to just return success from these three functions, right?
Relevant console-output: 009c:fixme:ntdll:NtCreatePowerRequest (0x22d5e8, 0x22d5f0): stub 009c:fixme:ntdll:NtSetPowerRequest (0x110ea80, 1): stub . . 009c:fixme:ntdll:NtClearPowerRequest (0x110ea80, 1): stub
https://bugs.winehq.org/show_bug.cgi?id=48521
--- Comment #1 from Louis Lenders xerox.xerox2000x@gmail.com --- Created attachment 66328 --> https://bugs.winehq.org/attachment.cgi?id=66328 patch to get around the errors
patch to get around the errors
https://bugs.winehq.org/show_bug.cgi?id=48521
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net URL|https://github.com/staxrip/ |https://web.archive.org/web |staxrip/releases |/20210305084512/https://git | |hub.com/staxrip/staxrip/rel | |eases/download/2.0.8.0/Stax | |Rip-x64-2.0.8.0-stable.7z Summary|StaxRip throes errors: |StaxRip 2.0.6.0 (.NET 4.7 |Win32Exception (2.0.6.0) |app) reports |Invalid function |'System.ComponentModel.Win3 |System.ComponentModel.Win32 |2Exception (0x80004005): |Exception (0x80004005): |Invalid function' when |Invalid function |converting AVI | |(ntdll.Nt{Clear,Create,Set} | |PowerRequest stubs need to | |return success)
--- Comment #2 from Anastasius Focht focht@gmx.net --- Hello folks,
adding stable download link via Internet Archive:
https://web.archive.org/web/20210305084512/https://github.com/staxrip/staxri...
https://source.winehq.org/git/wine.git/blob/31af1aeb7895bddf59a73886b89759f7...
$ sha1sum StaxRip-x64-2.0.8.0-stable.7z e8a77ec6c023f16c70c2d307cb65c46e2f317d1c StaxRip-x64-2.0.8.0-stable.7z
$ du -sh StaxRip-x64-2.0.8.0-stable.7z 196M StaxRip-x64-2.0.8.0-stable.7z
$ wine --version wine-6.3-168-g31af1aeb789
Regards
https://bugs.winehq.org/show_bug.cgi?id=48521
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch CC| |fgouget@codeweavers.com
https://bugs.winehq.org/show_bug.cgi?id=48521
--- Comment #3 from Louis Lenders xerox.xerox2000x@gmail.com --- Retested, still present and I sent patch upstream: https://gitlab.winehq.org/wine/wine/-/merge_requests/6302
Note: somehow now the program asks for some Segoui font and then there's a crash in gdiplus. Had to use native gdiplus to work around this, don't know why this new behaviour is present, did not see that when i opened this report irc.
I'll open a new bugreport for that crash
https://bugs.winehq.org/show_bug.cgi?id=48521
Louis Lenders xerox.xerox2000x@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|StaxRip 2.0.6.0 (.NET 4.7 |StaxRip 2.0.6.0 (.NET 4.7 |app) reports |app) reports |'System.ComponentModel.Win3 |'System.ComponentModel.Win3 |2Exception (0x80004005): |2Exception (0x80004005): |Invalid function' when |Invalid function' when |converting AVI |converting AVI |(ntdll.Nt{Clear,Create,Set} |(PowerRequest stubs need to |PowerRequest stubs need to |return success) |return success) | Component|ntdll |kernel32
--- Comment #4 from Louis Lenders xerox.xerox2000x@gmail.com --- changed component and title
https://bugs.winehq.org/show_bug.cgi?id=48521
Louis Lenders xerox.xerox2000x@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |272cb195d85799aa3cb6a7561db | |3a81564ef0a8d
--- Comment #5 from Louis Lenders xerox.xerox2000x@gmail.com --- This was fixed by 272cb195d85799aa3cb6a7561db3a81564ef0a8d
(and related b23c56e2a1ff0d0a9c7d452976825a6bc2303f14 and e2f6aa3874e25d7b225ae00df322a44f2fbc2820)
https://bugs.winehq.org/show_bug.cgi?id=48521
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 9.16.