There are still some issues I need to fix, mainly around timing conversion between MIDI and dmusic. Right now MIDI files seem to be cut off before the end is reached.
Please have a look at the general approach in the meantime, I need to know if this is the right way to do this or not.
--
v9: dmusic: Don't stop instrument downloading early on failure.
dmime: Create a band track for MIDI segments.
dmband: Move band.c to dmusic
dmband: Implement getting/setting GUID_BandParam on band tracks.
dmime/test: Add test for getting band track from midi file.
dmime: Implement IDirectMusicTrack_Play for MIDI tracks.
dmime: Implement getting/setting TempoParam for MIDI tracks.
dmime: Parse MIDI files.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4982
Theoretically, this allows debuggers to tell them apart. https://devblogs.microsoft.com/oldnewthing/20110429-00/?p=10803
But in practice, this is more about cleanliness than anything else; I'm not aware of anyone running SetLastError-aware debuggers in Wine. Feel free to reject if this is a waste of time.
The changeable SetLastError calls were found by this script:
```python
#!/usr/bin/env python3
import os
import re
for (dirpath, dirnames, filenames) in os.walk("."):
for fn in filenames:
if not fn.endswith(".c"):
continue
text = open(dirpath+"/"+fn,"rt").read()
text = text.replace("RtlSetLastWin32Error","SetLastError")
text = text.replace("RtlGetLastWin32Error","GetLastError")
if "SetLastError" not in text:
continue
varname = None
for line in text.split("\n"):
if "GetLastError" in line:
if m := re.search(r"([A-Za-z0-9_]+) *= *GetLastError", line):
prevline = line
varname = m[1]
if line == "}":
varname = None
if varname is not None and "SetLastError" in line:
if m := re.search(r"SetLastError\( *([A-Za-z0-9_]+) *\)", line):
if m[1] == varname:
print(dirpath+"/"+fn, prevline, line)
```
The script also flags https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/mpr/wnet.c#L2811, which is half set and half restore; I chose to left it unchanged.
Idea from https://gitlab.winehq.org/wine/wine/-/merge_requests/5020/diffs#6c845445f68…
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5035
There are still some issues I need to fix, mainly around timing conversion between MIDI and dmusic. Right now MIDI files seem to be cut off before the end is reached.
Please have a look at the general approach in the meantime, I need to know if this is the right way to do this or not.
--
v8: dmusic: Don't stop instrument downloading early on failure.
dmime: Create a band track for MIDI segments.
dmband: Move band.c to dmusic
dmband: Implement getting/setting GUID_BandParam on band tracks.
dmime/test: Add test for getting band track from midi file.
dmime: Implement IDirectMusicTrack_Play for MIDI tracks.
dmime: Implement getting/setting TempoParam for MIDI tracks.
dmime: Parse MIDI files.
dmime: Add stubs for MIDI tracks
dmime/test: add MIDI loading test
https://gitlab.winehq.org/wine/wine/-/merge_requests/4982
I originally added this for Minecraft Education Edition to see if it would help with a sign-in issue, but it didn't seem to so I didn't create an MR for it. But this library is also used by Office and other apps. For Office, there are 2 reports[[1](https://forum.winehq.org/viewtopic.php?p=138513)][[2](https://f… that say this is the cause of an installation crash. I can't confirm it as I don't have an Office subscription.
I have some more patches for this that Minecraft Education Edition calls but I don't know if they're helpful for Office.
--
v2: windows.security.authentication.onlineid: Implement IOnlineIdSystemAuthenticatorStatics::get_Default().
windows.security.authentication.onlineid: Add IOnlineIdServiceTicketRequestFactory stub interface.
windows.security.authentication.onlineid: Add IOnlineIdSystemAuthenticatorStatics stub interface.
windows.security.authentication.onlineid: Add stub DLL.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5021
# W.I.P
Code for parsing AUTOEXEC.BAT for environment variables was originally added in Windows NT 4.0. It's primary purpose was to make it so that Win32-based apps originally designed for Windows 9x that set environment variables using the file (as many did) would still work properly under NT. However, despite the fact that the last release of Windows 9x came out over 25 years ago, the feature still remains in Windows to this day. As is indicated by the period the feature was introduced during, it's mostly useful for running legacy software from around the time of the 9x to NT transition, but since it was never removed it's entirely possible that some newer software makes use of it as well. The feature is also toggleable using the ParseAutoexec value in the HCKU\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon registry key.
Note that this feature is entirely unrelated to the AUTOEXEC.NT file intended for use with NTVDM.
**Todo**
* [x] Add ParseAutoexec value to wine.inf.
* [x] Write code to check ParseAutoexec value.
* [x] Write code to parse Autoexec.bat for environment variables.
* [ ] Add code to concatenate the path to NTDLL.
--
v2: ntdll: Added autoexec.bat parsing code and ParseAutoexec value check. [1/2]
wine.inf: add ParseAutoexec to HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon
https://gitlab.winehq.org/wine/wine/-/merge_requests/5029