Repository: flutter
Issue: [windows] Unhandled exception at 0x00007FFC4362F8A8 (flutter_windows.dll) in myapp.exe: An invalid parameter was passed to a function that considers invalid parameters fatal.
Labels: waiting for customer response,platform-windows,a: desktop,team-windows

### Steps to reproduce

Hello, i am having a native windows crash in a pretty large enterprise app, i have captured a minidump with heap with visual studio that i am attaching. I am not sure what is the cause of the crash on the dart side so to say, i cannot pinpoint in code what the app is doing that causes the crash. There are lots of thing running some in parallel also. 

Edit: I have provided below a minim reproducible example. 

This is the native dump zipped [download](https://intergraphro-my.sharepoint.com/:u:/g/personal/iulian_ingr_ro/EfPa6GTXvyBFk3nq0C3ptj4BxQz8HYh44-4G5ZuMl7La5A?e=5jz0tg)



### Expected results

I expect the flutter engine not crash.

### Actual results

Flutter native engine crashes unexpectedly.

### Code sample

I cannot provide a minimum reproducible example because i don't know where is it crashing and the app codebase is very large. Furthermore the crash is on the native side where i as a flutter framework user have no access or desire to have access to it.


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[√] Flutter (Channel stable, 3.27.2, on Microsoft Windows [Version 10.0.19045.5247], locale en-GB)
    • Flutter version 3.27.2 on channel stable at C:\fluttersdk
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 68415ad1d9 (24 hours ago), 2025-01-13 10:22:03 -0800
    • Engine revision e672b006cb
    • Dart version 3.6.1
    • DevTools version 2.40.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\AndroidSDK\androidSDK
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = C:\AndroidSDK\androidSDK
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.12.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.12.35527.113
    • Windows 10 SDK version 10.0.20348.0

[√] Android Studio (version 2024.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)

[√] IntelliJ IDEA Community Edition (version 2024.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2024.2.3
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.96.3)
    • VS Code at C:\Users\csman\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.102.0

[√] Connected device (3 available)
    • Windows (desktop) • windows                                      • windows-x64    • Microsoft Windows [Version
      10.0.19045.5247]
    • Chrome (web)      • chrome                                       • web-javascript • Google Chrome 131.0.6778.265
    • Edge (web)        • edge                                         • web-javascript • Microsoft Edge 131.0.2903.112

[√] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>