Add screen def

This commit is contained in:
citronneur
2014-06-29 21:09:42 +02:00
parent 9af4280a68
commit cbb9976866
3 changed files with 27 additions and 6 deletions

View File

@@ -209,7 +209,7 @@ class ClientCoreSettings(CompositeType):
CompositeType.__init__(self)
self.rdpVersion = Version.RDP_VERSION_5_PLUS
self.desktopWidth = UInt16Le(1280)
self.desktopHeight = UInt16Le(1024)
self.desktopHeight = UInt16Le(800)
self.colorDepth = ColorDepth.RNS_UD_COLOR_8BPP
self.sasSequence = Sequence.RNS_UD_SAS_DEL
self.kbdLayout = KeyboardLayout.FRENCH

View File

@@ -45,9 +45,17 @@ class RDPController(object):
observer.onBitmapUpdate(rectangle.destLeft.value, rectangle.destTop.value, rectangle.destRight.value, rectangle.destBottom.value, rectangle.width.value, rectangle.height.value, rectangle.bitsPerPixel.value, (rectangle.flags & pdu.BitmapFlag.BITMAP_COMPRESSION).value, rectangle.bitmapDataStream.value)
class ClientFactory(protocol.Factory):
'''
"""
Factory of Client RDP protocol
'''
"""
def __init__(self, width = 1024, height = 800):
"""
@param width: width of screen
@param height: height of screen
"""
self._width = width
self._height = height
def buildProtocol(self, addr):
'''
Function call from twisted and build rdp protocol stack
@@ -55,7 +63,13 @@ class ClientFactory(protocol.Factory):
'''
controller = RDPController(LayerMode.CLIENT)
self.buildObserver(controller)
return tpkt.TPKT(tpdu.createClient(mcs.createClient(controller)));
mcsLayer = mcs.createClient(controller)
#set screen definition in MCS layer
mcsLayer._clientSettings.core.desktopHeight.value = self._height
mcsLayer._clientSettings.core.desktopWidth.value = self._width
return tpkt.TPKT(tpdu.createClient(mcsLayer));
def buildObserver(self, controller):
'''