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

Friendly overloads are missing SupportedOSPlatform #229

Closed
AArnott opened this issue Mar 31, 2021 · 0 comments · Fixed by #241
Closed

Friendly overloads are missing SupportedOSPlatform #229

AArnott opened this issue Mar 31, 2021 · 0 comments · Fixed by #241
Assignees
Labels
bug Something isn't working

Comments

@AArnott
Copy link
Member

AArnott commented Mar 31, 2021

Actual behavior

    internal static unsafe int GetStagedPackagePathByFullName2(string packageFullName, PackagePathType packagePathType, ref uint pathLength, PWSTR path)
    {
        fixed (uint *pathLengthLocal = &pathLength)
        {
            fixed (char *packageFullNameLocal = packageFullName)
            {
                int __result = PInvoke.GetStagedPackagePathByFullName2(packageFullNameLocal, packagePathType, pathLengthLocal, path);
                return __result;
            }
        }
    }

    [DllImport("api-ms-win-appmodel-runtime-l1-1-3", ExactSpelling = true)]
    [DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
    [SupportedOSPlatform("windows10.0.10240")]
    internal static extern unsafe int GetStagedPackagePathByFullName2(PCWSTR packageFullName, PackagePathType packagePathType, uint *pathLength, PWSTR path);

Expected behavior

The SupportedOSPlatform attribute should appear on the friendly overload as well or the analyzer can't do its work.

Repro steps

  1. NativeMethods.txt content:
GetStagedPackagePathByFullName2

Context

  • CsWin32 version: 0.1.435-beta
  • Target Framework: net5.0-windows7.0;net472;netstandard2.0
  • LangVersion (if explicitly set by project): 9
@AArnott AArnott added the bug Something isn't working label Mar 31, 2021
@AArnott AArnott self-assigned this Mar 31, 2021
@AArnott AArnott changed the title Friendly overloads are missing DefaultDllImportSearchPathsAttribute Friendly overloads are missing SupportedOSPlatform Apr 5, 2021
AArnott added a commit that referenced this issue Apr 5, 2021
AArnott pushed a commit that referenced this issue Jan 4, 2024
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.7.2 to 17.8.0.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md)
- [Commits](microsoft/vstest@v17.7.2...v17.8.0)

---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant