microsoft / microsoft/win32metadata

E_NOTFOUND returns the infotech.h value instead of the Win32 error HRESULT

Open
#2,251 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
1.5k
Forks
149
Avg merge
5d 16h
Merged PRs (30d)
4

Description

## Actual behavior

`E_NOTFOUND` generates:

`internal static readonly winmdroot.Foundation.HRESULT E_NOTFOUND = (winmdroot.Foundation.HRESULT)(-2147479539);`

This is the value from infotech.h:

`./um/infotech.h:#define E_NOTFOUND _HRESULT_TYPEDEF_(0x8000100DL)`

## Expected behavior

`internal static readonly winmdroot.Foundation.HRESULT E_NOTFOUND = (winmdroot.Foundation.HRESULT)(-2147023728);`

Which is the HRESULT for ERROR_NOT_FOUND (um/xamlOM.h and um/devicetopology.h and ./um/mmdeviceapi.h)

i.e.

`#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)`

## Repro steps

1. `NativeMethods.txt` content:
```
E_NOTFOUND
```

2. `NativeMethods.json` content (if present):
```json
```

3. Any of your own code that should be shared?

### Context

- CsWin32 version: `0.3.275`
- Win32Metadata version (if explicitly set by project):
- Target Framework: `net10.0-windows10.0.26100.0`
- `LangVersion` (if explicitly set by project): [e.g. `9`]

Contributor guide

Open the contributing guide

Research direction

Start by comparing the E_NOTFOUND definitions in um/infotech.h, um/xamlOM.h, um/devicetopology.h, and um/mmdeviceapi.h with the generated output from the NativeMethods.txt reproduction. Trace which metadata definition is selected, then verify that generation produces the ERROR_NOT_FOUND HRESULT shown in the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.