diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-08-01 23:30:23 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-08-01 23:30:23 -0700 |
commit | 4865b1dc6b37be40ff47df62dabafa2728c03e1d (patch) | |
tree | 9adffc0fadb6c5fefed0f5740d21fb81d7815c97 /xorg/server/module | |
parent | 6e3b7245aad0a768eecc66d52c4e32a6af8a7280 (diff) | |
download | xrdp-proprietary-4865b1dc6b37be40ff47df62dabafa2728c03e1d.tar.gz xrdp-proprietary-4865b1dc6b37be40ff47df62dabafa2728c03e1d.zip |
xorg driver, work on rdpup
Diffstat (limited to 'xorg/server/module')
-rw-r--r-- | xorg/server/module/rdpClientCon.c | 19 | ||||
-rw-r--r-- | xorg/server/module/rdpClientCon.h | 2 | ||||
-rw-r--r-- | xorg/server/module/rdpCursor.c | 8 | ||||
-rw-r--r-- | xorg/server/module/rdpMain.c | 36 |
4 files changed, 54 insertions, 11 deletions
diff --git a/xorg/server/module/rdpClientCon.c b/xorg/server/module/rdpClientCon.c index 44ab97ff..3edd1e0c 100644 --- a/xorg/server/module/rdpClientCon.c +++ b/xorg/server/module/rdpClientCon.c @@ -195,7 +195,6 @@ rdpClientConCheck(ScreenPtr pScreen) int rdpClientConInit(rdpPtr dev) { - char text[256]; int i; if (!g_directory_exist("/tmp/.xrdp")) @@ -208,19 +207,18 @@ rdpClientConInit(rdpPtr dev) return 0; } } - g_chmod_hex("/tmp/.xrdp", 0x1777); } - i = atoi(display); - if (i < 1) { + LLOGLN(0, ("rdpClientConInit: can not run at display < 1")); return 0; } g_sprintf(dev->uds_data, "/tmp/.xrdp/xrdp_display_%s", display); if (dev->listen_sck == 0) { + unlink(dev->uds_data); dev->listen_sck = g_tcp_local_socket_stream(); if (g_tcp_local_bind(dev->listen_sck, dev->uds_data) != 0) { @@ -232,3 +230,16 @@ rdpClientConInit(rdpPtr dev) } return 0; } + +/******************************************************************************/ +int +rdpClientConDeinit(rdpPtr dev) +{ + LLOGLN(0, ("rdpClientConDeinit:")); + if (dev->listen_sck != 0) + { + close(dev->listen_sck); + unlink(dev->uds_data); + } + return 0; +} diff --git a/xorg/server/module/rdpClientCon.h b/xorg/server/module/rdpClientCon.h index 717e4359..85a3925a 100644 --- a/xorg/server/module/rdpClientCon.h +++ b/xorg/server/module/rdpClientCon.h @@ -38,5 +38,7 @@ int rdpClientConCheck(ScreenPtr pScreen); int rdpClientConInit(rdpPtr dev); +int +rdpClientConDeinit(rdpPtr dev); #endif diff --git a/xorg/server/module/rdpCursor.c b/xorg/server/module/rdpCursor.c index 82aafd78..1e5ad311 100644 --- a/xorg/server/module/rdpCursor.c +++ b/xorg/server/module/rdpCursor.c @@ -38,6 +38,7 @@ cursor #include <mi.h> #include "rdp.h" +#include "rdpMain.h" /******************************************************************************/ #define LOG_LEVEL 1 @@ -49,7 +50,7 @@ Bool rdpSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs) { LLOGLN(0, ("rdpSpriteRealizeCursor:")); - return 1; + return TRUE; } /******************************************************************************/ @@ -57,7 +58,7 @@ Bool rdpSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs) { LLOGLN(0, ("rdpSpriteUnrealizeCursor:")); - return 1; + return TRUE; } /******************************************************************************/ @@ -80,7 +81,7 @@ Bool rdpSpriteDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScr) { LLOGLN(0, ("rdpSpriteDeviceCursorInitialize:")); - return 1; + return TRUE; } /******************************************************************************/ @@ -88,4 +89,5 @@ void rdpSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScr) { LLOGLN(0, ("rdpSpriteDeviceCursorCleanup:")); + xorgxrdpDownDown(pScr); } diff --git a/xorg/server/module/rdpMain.c b/xorg/server/module/rdpMain.c index f68bcef3..f19b06cd 100644 --- a/xorg/server/module/rdpMain.c +++ b/xorg/server/module/rdpMain.c @@ -39,6 +39,8 @@ rdp module main #include "rdp.h" #include "rdpInput.h" +#include "rdpDraw.h" +#include "rdpClientCon.h" /******************************************************************************/ #define LOG_LEVEL 1 @@ -53,22 +55,43 @@ rdp module main #define PACKAGE_VERSION_MINOR 0 #define PACKAGE_VERSION_PATCHLEVEL 0 -static int g_initialised = 0; +static Bool g_initialised = FALSE; /*****************************************************************************/ static pointer -xorgxrdpSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor) +xorgxrdpSetup(pointer Module, pointer Options, + int *ErrorMajor, int *ErrorMinor) { LLOGLN(0, ("xorgxrdpSetup:")); if (!g_initialised) { - g_initialised = 1; + g_initialised = TRUE; } rdpInputInit(); rdpPrivateInit(); return (pointer) 1; } +/*****************************************************************************/ +static void +xorgxrdpTearDown(pointer Module) +{ + LLOGLN(0, ("xorgxrdpTearDown:")); +} + +/*****************************************************************************/ +void +xorgxrdpDownDown(ScreenPtr pScreen) +{ + LLOGLN(0, ("xorgxrdpDownDown:")); + if (g_initialised) + { + g_initialised = FALSE; + LLOGLN(0, ("xorgxrdpDownDown: 1")); + rdpClientConDeinit(rdpGetDevFromScreen(pScreen)); + } +} + static MODULESETUPPROTO(xorgxrdpSetup); static XF86ModuleVersionInfo RDPVersRec = { @@ -86,4 +109,9 @@ static XF86ModuleVersionInfo RDPVersRec = { 0, 0, 0, 0 } }; -XF86ModuleData xorgxrdpModuleData = { &RDPVersRec, xorgxrdpSetup, NULL }; +_X_EXPORT XF86ModuleData xorgxrdpModuleData = +{ + &RDPVersRec, + xorgxrdpSetup, + xorgxrdpTearDown +}; |