Skip to content

SetLastError as true for Symbolic and Hard Link native APIs - #19566

Merged
Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
adityapatwardhan:FixSetLastError
May 1, 2023
Merged

Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
adityapatwardhan:FixSetLastError

Conversation

@adityapatwardhan

@adityapatwardhan Aditya Patwardhan (adityapatwardhan) commented Apr 25, 2023 •

Copy link
Copy Markdown
Member

PR Summary

Ensure the native PInvoke call has SetLastError in the LibraryImport attribuute. We use the last error to determine the correct fully qualified error id.

PR Context

PR Checklist

@iSazonov

Copy link
Copy Markdown
Collaborator

Could you please point a code where we use the last error? I don't see using GetLastWin32Error/GetLastError.

@SeeminglyScience

Copy link
Copy Markdown
Contributor

Could you please point a code where we use the last error? I don't see using GetLastWin32Error/GetLastError.

Yeah it's called here

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 72c81b8 into PowerShell:master May 1, 2023
@daxian-dbw Dongbo Wang (daxian-dbw) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label May 1, 2023
@ghost

Copy link
Copy Markdown

🎉v7.4.0-preview.4 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants