Index: trunk/src/VBox/Devices/Serial/DevSerial.cpp
===================================================================
--- trunk/src/VBox/Devices/Serial/DevSerial.cpp	(revision 6082)
+++ trunk/src/VBox/Devices/Serial/DevSerial.cpp	(revision 6087)
@@ -421,5 +421,5 @@
 }
 
-static DECLCALLBACK(int) serialNotifyStatusLinesChanged(PPDMICHARPORT pInterface, PDMICHARSTATUSLINES newStatusLines)
+static DECLCALLBACK(int) serialNotifyStatusLinesChanged(PPDMICHARPORT pInterface, uint32_t newStatusLines)
 {
     SerialState *pData = PDMICHARPORT_2_SERIALSTATE(pInterface);
Index: trunk/src/VBox/Devices/Serial/DrvChar.cpp
===================================================================
--- trunk/src/VBox/Devices/Serial/DrvChar.cpp	(revision 6082)
+++ trunk/src/VBox/Devices/Serial/DrvChar.cpp	(revision 6087)
@@ -271,8 +271,8 @@
  * @returns VBox status code
  * @param pInterface        Pointer to the interface structure.
- * @param RequestToSend     Set to 1 if this control line should be made active.
- * @param DataTerminalReady Set to 1 if this control line should be made active.
- */
-static DECLCALLBACK(int) drvCharSetModemLines(PPDMICHAR pInterface, unsigned RequestToSend, unsigned DataTerminalReady)
+ * @param RequestToSend     Set to true if this control line should be made active.
+ * @param DataTerminalReady Set to true if this control line should be made active.
+ */
+static DECLCALLBACK(int) drvCharSetModemLines(PPDMICHAR pInterface, bool RequestToSend, bool DataTerminalReady)
 {
     /* Nothing to do here. */
Index: trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp
===================================================================
--- trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp	(revision 6082)
+++ trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp	(revision 6087)
@@ -51,5 +51,5 @@
  */
 #ifndef TIOCM_LOOP
-# define TIOCM_LOOP	0x8000
+# define TIOCM_LOOP 0x8000
 #endif
 
@@ -690,7 +690,10 @@
 #endif
 
+    if (pThread->enmState == PDMTHREADSTATE_INITIALIZING)
+        return VINF_SUCCESS;
+
     while (pThread->enmState == PDMTHREADSTATE_RUNNING)
     {
-        PDMICHARSTATUSLINES newStatusLine = 0;
+        uint32_t newStatusLine = 0;
 
 #if defined(RT_OS_LINUX)
@@ -769,24 +772,40 @@
  * @returns VBox status code
  * @param pInterface        Pointer to the interface structure.
- * @param RequestToSend     Set to 1 if this control line should be made active.
- * @param DataTerminalReady Set to 1 if this control line should be made active.
- */
-static DECLCALLBACK(int) drvHostSerialSetModemLines(PPDMICHAR pInterface, unsigned RequestToSend, unsigned DataTerminalReady)
-{
+ * @param RequestToSend     Set to true if this control line should be made active.
+ * @param DataTerminalReady Set to true if this control line should be made active.
+ */
+static DECLCALLBACK(int) drvHostSerialSetModemLines(PPDMICHAR pInterface, bool RequestToSend, bool DataTerminalReady)
+{
+    PDRVHOSTSERIAL pData = PDMICHAR_2_DRVHOSTSERIAL(pInterface);
+
 #ifdef RT_OS_LINUX
-    PDRVHOSTSERIAL pData = PDMICHAR_2_DRVHOSTSERIAL(pInterface);
-    int modemState = 0;
+    int modemStateSet = 0;
+    int modemStateClear = 0;
 
     if (RequestToSend)
-    {
-        modemState |= TIOCM_RTS;
-    }
+        modemStateSet |= TIOCM_RTS;
+    else
+        modemStateClear |= TIOCM_RTS;
 
     if (DataTerminalReady)
-    {
-        modemState |= TIOCM_DTR;
-    }
-
-    ioctl(pData->DeviceFile, TIOCMBIS, &modemState);
+        modemStateSet |= TIOCM_DTR;
+    else
+        modemStateClear |= TIOCM_DTR;
+
+    if (modemStateSet)
+        ioctl(pData->DeviceFile, TIOCMBIS, &modemStateSet);
+
+    if (modemStateClear)
+        ioctl(pData->DeviceFile, TIOCMBIC, &modemStateClear);
+#elif defined(RT_OS_WINDOWS)
+    if (RequestToSend)
+        EscapeCommFunction(pData->hDeviceFile, SETRTS);
+    else
+        EscapeCommFunction(pData->hDeviceFIle, CLRRTS);
+
+    if (DataTerminalReady)
+        EscapeCommFunction(pData->hDeviceFile, SETDTR);
+    else
+        EscapeCommFunction(pData->hDeviceFIle, CLRDTR);
 #endif
 
