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

Added a catch-all for NTSTATUS for error codes we don't care about #471

Merged
merged 1 commit into from
May 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion pyrdp/enum/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@ class NTSTATUS(IntEnum):
[MS-ERREF]: Windows Error Codes
https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/87fba13e-bf06-450e-83b1-9241dc81e781
"""
@classmethod
# Some Clients can return other Error codes. Rather than hardcode 1000s
# of possible Status codes Just handle the ones we need to and create a catch-all
# for the ones we don't care about so we don't throw an exception.
def _missing_(cls, value):
other = NTSTATUS(0x00000000)
other._name_ = "STATUS_PYRDP_FAILURE"
other._value_ = value
return other

STATUS_SUCCESS = 0x00000000
STATUS_NO_MORE_FILES = 0x80000006
STATUS_NO_SUCH_FILE = 0xC000000F
STATUS_ACCESS_DENIED = 0xC0000022
STATUS_ACCESS_DENIED = 0xC0000022
Loading