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

RPC_S_ACCESS_DENIED has wrong value #1857

Closed
kennykerr opened this issue Feb 26, 2024 · 3 comments
Closed

RPC_S_ACCESS_DENIED has wrong value #1857

kennykerr opened this issue Feb 26, 2024 · 3 comments
Assignees

Comments

@kennykerr
Copy link
Contributor

In MSVC (default configuration) the following holds true:

#include <rpc.h>

int main()
{
    static_assert(RPC_S_ACCESS_DENIED == ERROR_ACCESS_DENIED);
}

Both ERROR_ACCESS_DENIED and RPC_S_ACCESS_DENIED are 5 because RPC_S_ACCESS_DENIED is defined as ERROR_ACCESS_DENIED in rpcnterr.h (line 41).

But the Win32 metadata seems to choose the definition from rpcnterr.h (line 540) where RPC_S_ACCESS_DENIED is defined as STATUS_ACCESS_DENIED. The difference is whether _KRPCENV_ is defined.

@kennykerr
Copy link
Contributor Author

The RPC constants in Windows.Win32.Foundation are also incorrectly typed as int while the RPC constants in Windows.Win32.System.Rpc use the RPC_STATUS type. Can we get them all consolidated under the Windows.Win32.System.Rpc.RPC_STATUS enum?

@mikebattista
Copy link
Collaborator

The enum is typed as int. Should that be uint?

@kennykerr
Copy link
Contributor Author

The sign bit does not appear to be used for RPC_STATUS so it behaves more like WIN32_ERROR but it is defined as long which is int so I don't have a problem with leaving it as is.

@mikebattista mikebattista self-assigned this Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants