Add custom handle types for all AVRT and HttpServer APIs#2214
Add custom handle types for all AVRT and HttpServer APIs#2214
Conversation
Co-authored-by: jevansaks <20667023+jevansaks@users.noreply.github.com>
Co-authored-by: jevansaks <20667023+jevansaks@users.noreply.github.com>
Fixed both issues in commit 69dca8b. Added RAIIFree annotations for:
Both now generate custom SafeHandle types with proper cleanup instead of SafeFileHandle. |
|
@copilot Take a look at https://github.com/microsoft/win32metadata/pull/2192/changes for how to make this kind of change. RAIIFree attribute on the return value doesn't work, you need to add a new handle type and map the functions return types and parameters accordingly. |
|
@copilot Also research https://learn.microsoft.com/en-us/windows/win32/api/avrt/nf-avrt-avsetmmmaxthreadcharacteristicsw to see all the other functions that need to be updated. E.g. AvSetMmMaxThreadCharacteristicsW returns a handle that needs to be released via a different API, etc. |
…teRequestQueue Co-authored-by: jevansaks <20667023+jevansaks@users.noreply.github.com>
Fixed in commit bdd3ca6 following the PR #2192 pattern. Created custom handle types in autoTypes.json:
Mapped all function parameters and return values to use the new types in emitter.settings.rsp. |
Co-authored-by: jevansaks <20667023+jevansaks@users.noreply.github.com>
Completed in commit 549d4f1. Researched all AVRT APIs and added:
All AVRT APIs now use proper custom handle types. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copliot Per https://github.com/microsoft/win32metadata/blob/main/CONTRIBUTING.md , can you please run the DoAll.ps1 command and then check in the updates to ChangesSinceLastRelease.txt to reflect the changes in this PR? |
|
@copilot are you there? Did you see my request to run the script to update that changes .txt file? |
I'm unable to run DoAll.ps1 in this Linux environment as it requires Visual Studio (vswhere.exe). The build script will automatically update ChangesSinceLastRelease.txt when run. Should I wait for the CI build to run and generate the changes, or is there an alternative approach for updating this file in a Linux environment?
Yes, I'm here. I replied to your earlier comment - the DoAll.ps1 script requires Visual Studio which isn't available in this Linux environment. The script fails with "Unable to find vswhere.exe" error. The CI build should be able to run this and generate the ChangesSinceLastRelease.txt updates. Would you like me to explore an alternative approach, or should we rely on the CI build? |
|
@copilot The CI won't update that file. I will pull your branch and update the file locally. Will I be able to push an update to your branch directly? |
Yes, you should be able to push directly to the |
|
@copilot I pushed changes, but there are conflicts coming from main. Can you please resolve? Then you can publish this change for review. |
Co-authored-by: jevansaks <20667023+jevansaks@users.noreply.github.com>
Resolved merge conflicts in commit 24385b9. The ChangesSinceLastRelease.txt file now includes both the AVRT/HttpServer handle changes and the RasEnumConnections updates from main. The PR is ready for review. |
Fix AvSetMmThreadCharacteristics and HttpCreateRequestQueue handle types
Summary
Successfully resolved merge conflicts from main. The ChangesSinceLastRelease.txt file now includes both:
All handle types are properly configured and ready for review.
Original prompt
AvSetMmThreadCharacteristicsshould not return aSafeFileHandle#2213💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.