microsoft / microsoft/win32metadata
Should the Msi* methods be returning a WIN32_ERROR?
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 149
- Avg merge
- 5d 16h
- Merged PRs (30d)
- 4
Description
Actual behavior
This might be one for win32metadata, but reporting here in case it isn't. Most Msi* currently return a uint, however the return value is typically a WIN32_ERROR value. Using MsiExtractPatchXMLData() as an example, you can see it states several WIN32_ERROR values it may return.
Comparing this with something like SetNamedSecurityInfo(), this returns a DWORD (ultimately a uint), however CsWin32 returns this correctly as a WIN32_ERROR value for the caller's convenience.
Expected behavior
That if a method is returning a WIN32_ERROR value, it should be cast as that without the caller having to work it out for themselves.
Repro steps
NativeMethods.txtcontent:
MsiExtractPatchXMLData
-
NativeMethods.jsoncontent (if present): N/A -
Any of your own code that should be shared? N/A
Context
- CsWin32 version: 0.3.0264
- Win32Metadata version (if explicitly set by project): N/A
- Target Framework: net472
LangVersion(if explicitly set by project): N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the NativeMethods.txt repro for MsiExtractPatchXMLData and inspect how its return type is represented in Win32Metadata and exposed by CsWin32. Compare it with SetNamedSecurityInfo and verify that the generated method uses WIN32_ERROR without requiring caller-side conversion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, csharp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100