diff -Npur xrdp-old/sesman/config.c xrdp-new/sesman/config.c
--- xrdp-old/sesman/config.c	2010-04-26 20:47:16.000000000 +0800
+++ xrdp-new/sesman/config.c	2010-04-26 21:22:03.000000000 +0800
@@ -93,6 +93,7 @@ config_read(struct config_sesman* cfg)
   config_read_vnc_params(fd, cfg, param_n, param_v);
   config_read_rdp_params(fd, cfg, param_n, param_v);
   config_read_dmx_params(fd, cfg, param_n, param_v);
+  config_read_dmx_backend_params(fd, cfg, param_n, param_v);
 
   /* read logging config */
   config_read_logging(fd, &(cfg->log), param_n, param_v);
@@ -450,6 +451,39 @@ config_read_dmx_params(int file, struct
   for (i = 0; i < cs->dmx_params->count; i++)
   {
     g_printf("\tParameter %02d                   %s\r\n", i, (char*)list_get_item(cs->dmx_params, i));
+  }
+
+  return 0;
+}
+
+/******************************************************************************/
+int DEFAULT_CC
+config_read_dmx_backend_params(int file, struct config_sesman* cs, struct list* param_n,
+                       struct list* param_v)
+{
+  int i;
+  char *buf;
+
+  list_clear(param_v);
+  list_clear(param_n);
+  cs->dmx_backend=0;
+  cs->dmx_backend_params=list_create();
+  file_read_section(file, SESMAN_CFG_DMX_BACKEND_PARAMS, param_n, param_v);
+  for (i = 0; i < param_n->count; i++)
+  {
+    buf = (char*)list_get_item(param_n, i);
+    if (0 == g_strcasecmp(buf, SESMAN_CFG_DMX_BACKEND))
+    {
+      cs->dmx_backend = g_strdup((char*)list_get_item(param_v, i));
+    } else
+      list_add_item(cs->dmx_backend_params, (long)g_strdup((char*)list_get_item(param_v, i)));
+  }
+
+  /* printing security config */
+  g_printf("Xdmx backend [%s], its parameters:\r\n", cs->dmx_backend);
+  for (i = 0; i < cs->dmx_params->count; i++)
+  {
+    g_printf("\tParameter %02d                   %s\r\n", i, (char*)list_get_item(cs->dmx_params, i));
   }
 
   return 0;
diff -Npur xrdp-old/sesman/config.h xrdp-new/sesman/config.h
--- xrdp-old/sesman/config.h	2010-04-26 20:46:20.000000000 +0800
+++ xrdp-new/sesman/config.h	2010-04-26 21:22:00.000000000 +0800
@@ -54,6 +54,8 @@
 #define SESMAN_CFG_RDP_PARAMS        "X11rdp"
 #define SESMAN_CFG_VNC_PARAMS        "Xvnc"
 #define SESMAN_CFG_DMX_PARAMS        "Xdmx"
+#define SESMAN_CFG_DMX_BACKEND_PARAMS "XdmxBackend"
+#define SESMAN_CFG_DMX_BACKEND       "Backend"
 
 #define SESMAN_CFG_LOGGING           "Logging"
 #define SESMAN_CFG_LOG_FILE          "LogFile"
@@ -193,6 +195,16 @@ struct config_sesman
    */
   struct list* dmx_params;
   /**
+   * @var dmx_backend;
+   * @brief the backend which dmx choose
+   */
+  char *dmx_backend;
+  /**
+   * @var dmx_backend_params;
+   * @brief Xdmx backend additional parameter list
+   */
+  struct list* dmx_backend_params;
+  /**
    * @var log
    * @brief Log configuration struct
    */
@@ -319,5 +331,18 @@ int DEFAULT_CC
 config_read_dmx_params(int file, struct config_sesman* cs, struct list* param_n,
                        struct list* param_v);
 
+/**
+ *
+ * @brief Reads sesman [XdmxBackend] configuration section
+ * @param file configuration file descriptor
+ * @param cs pointer to a config_sesman struct
+ * @param param_n parameter name list
+ * @param param_v parameter value list
+ * @return 0 on success, 1 on failure
+ *
+ */
+int DEFAULT_CC
+config_read_dmx_backend_params(int file, struct config_sesman* cs, struct list* param_n,
+                       struct list* param_v);
 #endif
 
diff -Npur xrdp-old/sesman/sesman.ini xrdp-new/sesman/sesman.ini
--- xrdp-old/sesman/sesman.ini	2010-04-26 20:43:42.000000000 +0800
+++ xrdp-new/sesman/sesman.ini	2010-04-26 20:46:02.000000000 +0800
@@ -34,5 +34,6 @@ param1=-br
 param2=-noreset
 param3=-nolisten
 param4=tcp
-param5=--
-param6=/usr/bin/Xfake
+
+[XdmxBackend]
+Backend=/usr/bin/Xfake
diff -Npur xrdp-old/sesman/session.c xrdp-new/sesman/session.c
--- xrdp-old/sesman/session.c	2010-04-26 21:04:36.000000000 +0800
+++ xrdp-new/sesman/session.c	2010-04-26 21:51:08.000000000 +0800
@@ -716,6 +716,8 @@ for user %s denied", username);
           /* these are the must have parameters */
           list_add_item(xserver_params, (long)g_strdup("Xdmx"));
           list_add_item(xserver_params, (long)g_strdup(screen));
+	  list_add_item(xserver_params, (long)g_strdup("-depth"));
+	  list_add_item(xserver_params, (long)g_strdup(depth));
 
 #ifndef _WIN32
 	  list_add_item(xserver_params, (long)g_strdup("-auth"));
@@ -725,6 +727,19 @@ for user %s denied", username);
           /* additional parameters from sesman.ini file */
           list_append_list_strdup(g_cfg->dmx_params, xserver_params, 0);
 
+          list_add_item(xserver_params, (long)g_strdup("--"));
+          list_add_item(xserver_params, (long)g_strdup(g_cfg->dmx_backend));
+
+          /* additional parameters from sesman.ini file */
+          list_append_list_strdup(g_cfg->dmx_backend_params, xserver_params, 0);
+          if (strstr (g_cfg->dmx_backend, "Xfake")) /* if the backend was Xfake, use the '-screen' param */
+          {
+            char geometry_depth [32];
+            g_sprintf(geometry_depth, "%dx%dx%d", width, height, bpp);
+            list_add_item(xserver_params, (long)g_strdup("-screen"));
+            list_add_item(xserver_params, (long)g_strdup(geometry_depth));  
+          }
+
 	  /* make sure it ends with a zero */
 	  list_add_item(xserver_params, 0);
           pp1 = (char**)xserver_params->items;
