Skip to content

Commit

Permalink
Log unknown NTSTATUS values
Browse files Browse the repository at this point in the history
  • Loading branch information
obilodeau committed May 31, 2024
1 parent 051f937 commit f03bacf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyrdp/parser/rdp/virtual_channel/device_redirection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
FileCreateOptions, FileShareAccess, FileSystemInformationClass, \
GeneralCapabilityVersion, MajorFunction, MinorFunction, \
RDPDRCapabilityType, NTSTATUS
from pyrdp.logging import log
from pyrdp.parser import Parser
from pyrdp.pdu import DeviceAnnounce, DeviceCloseRequestPDU, DeviceCloseResponsePDU, DeviceCreateRequestPDU, \
DeviceCreateResponsePDU, DeviceDirectoryControlResponsePDU, DeviceIORequestPDU, DeviceIOResponsePDU, \
Expand Down Expand Up @@ -296,6 +297,8 @@ def parseDeviceIOResponse(self, stream: BytesIO) -> DeviceIOResponsePDU:
deviceID = Uint32LE.unpack(stream)
completionID = Uint32LE.unpack(stream)
ioStatus = NTSTATUS(Uint32LE.unpack(stream))
if ioStatus._name_ == "STATUS_PYRDP_FAILURE":
log.error("Unknown NTSTATUS value: %(value)", {"value": ioStatus._value_})

majorFunction = self.majorFunctionsForParsingResponse.pop(completionID, None)

Expand Down

0 comments on commit f03bacf

Please sign in to comment.