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

Handle missing RDPVersion numbers thrown by some RDP clients #477

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 12 additions & 0 deletions pyrdp/enum/rdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,17 @@ class ConnectionDataType(IntEnum):


class RDPVersion(IntEnum):

@classmethod
# Some Clients can return other version numbers. Rather than hardcode 100s
# of possible version 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 = RDPVersion(0x80001)
other._name_ = "RDP_UNKNOWN"
other._value_ = value
return other

RDP4 = 0x80001
RDP5 = 0x80004
RDP10 = 0x80005
Expand All @@ -255,6 +266,7 @@ class RDPVersion(IntEnum):
RDP10_9 = 0x8000e
RDP10_10 = 0x8000f
RDP10_11 = 0x80010
RDP10_12 = 0x80011


class ColorDepth(IntEnum):
Expand Down
Loading