Skip to content

Commit

Permalink
Merge pull request #471 from luciaprime54/fix/windows-error-codes
Browse files Browse the repository at this point in the history
Added a catch-all for NTSTATUS for error codes we don't care about
  • Loading branch information
obilodeau committed May 31, 2024
2 parents b8404ea + e19bf28 commit 051f937
Showing 1 changed file with 11 additions and 1 deletion.
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

0 comments on commit 051f937

Please sign in to comment.