Skip to content

Require CETCompat to be false and other improvements#15

Merged
ds5678 merged 5 commits intoAssetRipper:masterfrom
Muppetsg2:master
Jan 3, 2026
Merged

Require CETCompat to be false and other improvements#15
ds5678 merged 5 commits intoAssetRipper:masterfrom
Muppetsg2:master

Conversation

@Muppetsg2
Copy link
Contributor

Solves issue described here:
AssetRipper/AssetRipper#2047
@ds5678
Copy link
Member

ds5678 commented Dec 29, 2025

Thank you for your investigation and pull request. I will review it thoroughly when I return on Wednesday. However, a few things come to mind.

  • AssetRipper uses .NET 10. I assume this runtime bug persists in 10? Please bump the .NET versions in this project to 10.
  • AssetRipper will need a corresponding pull request to be fixed.
  • Can you add some documentation to the readme about the necessity for downstream projects to use this attribute?
  • This pull request has some other changes than the one mentioned in your title and description. Can you provide some reasoning for those changes?

@Muppetsg2
Copy link
Contributor Author

Muppetsg2 commented Dec 29, 2025

This pull request has some other changes than the one mentioned in your title and description. Can you provide some reasoning for those changes?

While investigating the issue, I noticed two inconsistencies in the code. Here is the reasoning behind each change:

  1. The trailing \0\0 was added to the filter string because terrafx.interop.windows uses GetOpenFileNameW from commdlg.dll. According to the Microsoft documentation for OPENFILENAMEW, lpstrFilter must contain pairs of null-terminated strings, and the buffer itself must end with two null characters. Previously, the filter was only terminated with a single \0.

  2. The OFN.OFN_EXPLORER flag was explicitly set in OpenFileWindows to ensure the dialog always uses the modern (Explorer-style) UI. While the dialog may still open in the new style without this flag (for example, when OFN.OFN_ALLOWMULTISELECT is not set), the flag was kept to consistently enforce the modern dialog behavior.

@Muppetsg2
Copy link
Contributor Author

Yes, this bug still reproduces on .NET 10. I verified it after switching the project to .NET 10 and enabling CETCompat.

If it’s helpful, I also noticed that terrafx.interop.windows has received recent updates.

@ds5678
Copy link
Member

ds5678 commented Dec 29, 2025

The .NET version doesn't need to be set in the csproj files. The one in the API project was an accident and can be removed.

You can bump TerraFX.

@ds5678
Copy link
Member

ds5678 commented Dec 29, 2025

Why the (*.*) change?

Can you add a link in your readme description to the issue you linked above?

@Muppetsg2
Copy link
Contributor Author

Why the (*.*) change?

All Files (*.*) follows the standard Windows file dialog convention, where the filter description is paired with the file pattern it represents.

- Changed TerraFX version from 10.0.26100.2 -> 10.0.26100.6
- Changed net9.0 path to net10.0 in publish.yaml
- Removed TargetFramework property from .csproj
- Added links to similar issues in README.md
@ds5678
Copy link
Member

ds5678 commented Dec 29, 2025

I still want to try it on my computer, but this tentatively looks good.

@ds5678
Copy link
Member

ds5678 commented Dec 29, 2025

This project also has some other types of dialogs. Do all of them now work on your PC?

To stay consistent with the standard convention and keep the behavior uniform across dialogs, I also changed All Files to All Files (*.*) in the Save File dialog.
@Muppetsg2
Copy link
Contributor Author

Muppetsg2 commented Dec 29, 2025

Do all of them now work on your PC?

Yes, I tested all of them and they work as expected.

To stay consistent with the standard convention and keep the behavior uniform across dialogs, I also changed All Files to All Files (*.*) in the Save File dialog.

@ds5678
Copy link
Member

ds5678 commented Dec 29, 2025

Confirmation and message dialogs work fine?

@Muppetsg2
Copy link
Contributor Author

Muppetsg2 commented Dec 29, 2025

Confirmation and message dialogs work fine?

Yes

@ds5678 ds5678 changed the title Disable CETCompat Require CETCompat to be false and other improvements Jan 3, 2026
@ds5678 ds5678 merged commit efd1956 into AssetRipper:master Jan 3, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants