Index: /trunk/include/VBox/HostServices/GuestControlSvc.h
===================================================================
--- /trunk/include/VBox/HostServices/GuestControlSvc.h	(revision 38132)
+++ /trunk/include/VBox/HostServices/GuestControlSvc.h	(revision 38133)
@@ -4,5 +4,5 @@
 
 /*
- * Copyright (C) 2010 Oracle Corporation
+ * Copyright (C) 2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -183,26 +183,4 @@
 typedef CALLBACKDATAEXECINSTATUS *PCALLBACKDATAEXECINSTATUS;
 
-typedef struct VBoxGuestCtrlCallbackDataDirOpen
-{
-    /** Callback data header. */
-    CALLBACKHEADER hdr;
-    /** The native node id. */
-    uint32_t u32Handle;
-} CALLBACKDATADIROPEN;
-typedef CALLBACKDATADIROPEN *PCALLBACKDATADIROPEN;
-
-typedef struct VBoxGuestCtrlCallbackDataDirRead
-{
-    /** Callback data header. */
-    CALLBACKHEADER hdr;
-    /** The native node id. */
-    uint64_t u64NodeId;
-    /** The entry name. */
-    char *pszName;
-    /** Size (in bytes) of entry name. */
-    uint32_t cbName;
-} CALLBACKDATADIRREAD;
-typedef CALLBACKDATADIRREAD *PCALLBACKDATADIRREAD;
-
 enum eVBoxGuestCtrlCallbackDataMagic
 {
@@ -211,8 +189,5 @@
     CALLBACKDATAMAGIC_EXEC_STATUS = 0x26011982,
     CALLBACKDATAMAGIC_EXEC_OUT = 0x11061949,
-    CALLBACKDATAMAGIC_EXEC_IN_STATUS = 0x19091951,
-
-    CALLBACKDATAMAGIC_DIR_OPEN = 0x05031907,
-    CALLBACKDATAMAGIC_DIR_READ = 0x02041932
+    CALLBACKDATAMAGIC_EXEC_IN_STATUS = 0x19091951
 };
 
@@ -223,8 +198,5 @@
     VBOXGUESTCTRLCALLBACKTYPE_EXEC_START = 1,
     VBOXGUESTCTRLCALLBACKTYPE_EXEC_OUTPUT = 2,
-    VBOXGUESTCTRLCALLBACKTYPE_EXEC_INPUT_STATUS = 3,
-
-    VBOXGUESTCTRLCALLBACKTYPE_DIR_OPEN = 100,
-    VBOXGUESTCTRLCALLBACKTYPE_DIR_READ = 105
+    VBOXGUESTCTRLCALLBACKTYPE_EXEC_INPUT_STATUS = 3
 };
 
@@ -256,22 +228,5 @@
      * new data on stdout/stderr, process terminated etc.
      */
-    HOST_EXEC_GET_OUTPUT = 102,
-
-    /*
-     * Directory handling.
-     */
-
-    /**
-     * Opens a directory for reading.
-     */
-    HOST_DIR_OPEN = 200,
-    /**
-     * Closes a formerly opened directory.
-     */
-    HOST_DIR_CLOSE = 201,
-    /**
-     * Reads the next entry from an open directory.
-     */
-    HOST_DIR_READ = 202
+    HOST_EXEC_GET_OUTPUT = 102
 };
 
@@ -314,18 +269,5 @@
      * Guests sends an input status notification to the host.
      */
-    GUEST_EXEC_SEND_INPUT_STATUS = 102,
-
-    /*
-     * Directory handling.
-     */
-
-    /**
-     * Guest sends back the directory handle.
-     */
-    GUEST_DIR_SEND_OPEN = 200,
-    /**
-     * Guest sends back the next directory entry.
-     */
-    GUEST_DIR_SEND_READ = 202
+    GUEST_EXEC_SEND_INPUT_STATUS = 102
 };
 
@@ -470,53 +412,4 @@
 } VBoxGuestCtrlHGCMMsgExecStatusIn;
 
-/**
- * Closes a formerly openend guest directory.
- */
-typedef struct VBoxGuestCtrlHGCMMsgDirClose
-{
-    VBoxGuestHGCMCallInfo hdr;
-    /** Context ID. */
-    HGCMFunctionParameter context;
-    /** Directory handle to close. */
-    HGCMFunctionParameter handle;
-
-} VBoxGuestCtrlHGCMMsgDirClose;
-
-/**
- * Opens a guest directory for reading.
- */
-typedef struct VBoxGuestCtrlHGCMMsgDirOpen
-{
-    VBoxGuestHGCMCallInfo hdr;
-    /** Context ID. */
-    HGCMFunctionParameter context;
-    /** Directory (path) to open. */
-    HGCMFunctionParameter directory;
-    /** Filter (DOS style wildcard). */
-    HGCMFunctionParameter filter;
-    /** Open flags. */
-    HGCMFunctionParameter flags;
-    /** The user name to run the executed command under. */
-    HGCMFunctionParameter username;
-    /** The user's password. */
-    HGCMFunctionParameter password;
-    /** OUT: Handle for opened directory. */
-    HGCMFunctionParameter handle;
-
-} VBoxGuestCtrlHGCMMsgDirOpen;
-
-/**
- * Reads next entry of an open guest directory.
- */
-typedef struct VBoxGuestCtrlHGCMMsgDirRead
-{
-    VBoxGuestHGCMCallInfo hdr;
-    /** Context ID. */
-    HGCMFunctionParameter context;
-    /** Directory handle to read from. */
-    HGCMFunctionParameter handle;
-
-} VBoxGuestCtrlHGCMMsgDirRead;
-
 #pragma pack ()
 
Index: /trunk/include/VBox/VBoxGuestLib.h
===================================================================
--- /trunk/include/VBox/VBoxGuestLib.h	(revision 38132)
+++ /trunk/include/VBox/VBoxGuestLib.h	(revision 38133)
@@ -549,17 +549,4 @@
 VBGLR3DECL(int)     VbglR3GuestCtrlWaitForHostMsg(uint32_t u32ClientId, uint32_t *puMsg, uint32_t *puNumParms);
 VBGLR3DECL(int)     VbglR3GuestCtrlCancelPendingWaits(uint32_t u32ClientId);
-
-VBGLR3DECL(int) VbglR3GuestCtrlGetCmdDirClose(uint32_t  u32ClientId,    uint32_t  uNumParms,
-                                              uint32_t *puContext,      uint32_t *puHandle);
-VBGLR3DECL(int) VbglR3GuestCtrlGetCmdDirOpen(uint32_t  u32ClientId,    uint32_t  uNumParms,
-                                             uint32_t *puContext,
-                                             char     *pszDir,         uint32_t  cbDir,
-                                             char     *pszFilter,      uint32_t  cbFilter,
-                                             uint32_t *puFlags,
-                                             char     *pszUser,        uint32_t  cbUser,
-                                             char     *pszPassword,    uint32_t  cbPassword);
-VBGLR3DECL(int) VbglR3GuestCtrlGetCmdDirRead(uint32_t  u32ClientId,    uint32_t  uNumParms,
-                                             uint32_t *puContext,      uint32_t *puHandle);
-
 VBGLR3DECL(int)     VbglR3GuestCtrlExecGetHostCmd(uint32_t  u32ClientId,    uint32_t  uNumParms,
                                                   uint32_t *puContext,
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestCtrl.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestCtrl.cpp	(revision 38132)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestCtrl.cpp	(revision 38133)
@@ -152,136 +152,4 @@
         if (RT_FAILURE(rc2))
             rc = rc2;
-    }
-    return rc;
-}
-
-
-/**
- * Closes a formerly opened guest directory.
- *
- * @return  IPRT status code.
- ** @todo Docs!
- */
-VBGLR3DECL(int) VbglR3GuestCtrlGetCmdDirClose(uint32_t  u32ClientId,    uint32_t  uNumParms,
-                                              uint32_t *puContext,      uint32_t *puHandle)
-{
-    AssertPtrReturn(puContext, VERR_INVALID_PARAMETER);
-    AssertPtrReturn(puHandle, VERR_INVALID_PARAMETER);
-
-    VBoxGuestCtrlHGCMMsgDirClose Msg;
-
-    Msg.hdr.result = VERR_WRONG_ORDER;
-    Msg.hdr.u32ClientID = u32ClientId;
-    Msg.hdr.u32Function = GUEST_GET_HOST_MSG;
-    Msg.hdr.cParms = uNumParms;
-
-    VbglHGCMParmUInt32Set(&Msg.context, 0);
-    VbglHGCMParmUInt32Set(&Msg.handle, 0);
-
-    int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg));
-    if (RT_SUCCESS(rc))
-    {
-        int rc2 = Msg.hdr.result;
-        if (RT_FAILURE(rc2))
-        {
-            rc = rc2;
-        }
-        else
-        {
-            Msg.context.GetUInt32(puContext);
-            Msg.handle.GetUInt32(puHandle);
-        }
-    }
-    return rc;
-}
-
-
-/**
- * Opens a guest directory for reading.
- *
- * @return  IPRT status code.
- ** @todo Docs!
- */
-VBGLR3DECL(int) VbglR3GuestCtrlGetCmdDirOpen(uint32_t  u32ClientId,    uint32_t  uNumParms,
-                                             uint32_t *puContext,
-                                             char     *pszDir,         uint32_t  cbDir,
-                                             char     *pszFilter,      uint32_t  cbFilter,
-                                             uint32_t *puFlags,
-                                             char     *pszUser,        uint32_t  cbUser,
-                                             char     *pszPassword,    uint32_t  cbPassword)
-{
-    AssertPtrReturn(pszDir, VERR_INVALID_PARAMETER);
-    AssertPtrReturn(pszFilter, VERR_INVALID_PARAMETER);
-    AssertPtrReturn(puFlags, VERR_INVALID_PARAMETER);
-    AssertPtrReturn(pszUser, VERR_INVALID_PARAMETER);
-    AssertPtrReturn(pszPassword, VERR_INVALID_PARAMETER);
-
-    VBoxGuestCtrlHGCMMsgDirOpen Msg;
-
-    Msg.hdr.result = VERR_WRONG_ORDER;
-    Msg.hdr.u32ClientID = u32ClientId;
-    Msg.hdr.u32Function = GUEST_GET_HOST_MSG;
-    Msg.hdr.cParms = uNumParms;
-
-    VbglHGCMParmUInt32Set(&Msg.context, 0);
-    VbglHGCMParmPtrSet(&Msg.directory, pszDir, cbDir);
-    VbglHGCMParmPtrSet(&Msg.filter, pszFilter, cbFilter);
-    VbglHGCMParmUInt32Set(&Msg.flags, 0);
-    VbglHGCMParmPtrSet(&Msg.username, pszUser, cbUser);
-    VbglHGCMParmPtrSet(&Msg.password, pszPassword, cbPassword);
-
-    int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg));
-    if (RT_SUCCESS(rc))
-    {
-        int rc2 = Msg.hdr.result;
-        if (RT_FAILURE(rc2))
-        {
-            rc = rc2;
-        }
-        else
-        {
-            Msg.context.GetUInt32(puContext);
-            Msg.flags.GetUInt32(puFlags);
-        }
-    }
-    return rc;
-}
-
-
-/**
- * Opens a guest directory for reading.
- *
- * @return  IPRT status code.
- ** @todo Docs!
- */
-VBGLR3DECL(int) VbglR3GuestCtrlGetCmdDirRead(uint32_t  u32ClientId,    uint32_t  uNumParms,
-                                             uint32_t *puContext,      uint32_t *puHandle)
-{
-    AssertPtrReturn(puContext, VERR_INVALID_PARAMETER);
-    AssertPtrReturn(puHandle, VERR_INVALID_PARAMETER);
-
-    VBoxGuestCtrlHGCMMsgDirRead Msg;
-
-    Msg.hdr.result = VERR_WRONG_ORDER;
-    Msg.hdr.u32ClientID = u32ClientId;
-    Msg.hdr.u32Function = GUEST_GET_HOST_MSG;
-    Msg.hdr.cParms = uNumParms;
-
-    VbglHGCMParmUInt32Set(&Msg.context, 0);
-    VbglHGCMParmUInt32Set(&Msg.handle, 0);
-
-    int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg));
-    if (RT_SUCCESS(rc))
-    {
-        int rc2 = Msg.hdr.result;
-        if (RT_FAILURE(rc2))
-        {
-            rc = rc2;
-        }
-        else
-        {
-            Msg.context.GetUInt32(puContext);
-            Msg.handle.GetUInt32(puHandle);
-        }
     }
     return rc;
Index: /trunk/src/VBox/Additions/common/VBoxService/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxService/Makefile.kmk	(revision 38132)
+++ /trunk/src/VBox/Additions/common/VBoxService/Makefile.kmk	(revision 38133)
@@ -69,5 +69,4 @@
  VBoxService_SOURCES    += \
  	VBoxServiceControl.cpp \
-	VBoxServiceControlDir.cpp \
  	VBoxServiceControlExec.cpp \
 	VBoxServiceControlExecThread.cpp \
Index: /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp	(revision 38132)
+++ /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp	(revision 38133)
@@ -162,16 +162,4 @@
                 case HOST_EXEC_GET_OUTPUT:
                     rc = VBoxServiceControlExecHandleCmdGetOutput(g_GuestControlSvcClientID, uNumParms);
-                    break;
-
-                case HOST_DIR_CLOSE:
-                    rc = VBoxServiceGCtrlDirClose(g_GuestControlSvcClientID, uNumParms);
-                    break;
-
-                case HOST_DIR_OPEN:
-                    rc = VBoxServiceGCtrlDirOpen(g_GuestControlSvcClientID, uNumParms);
-                    break;
-
-                case HOST_DIR_READ:
-                    rc = VBoxServiceGCtrlDirRead(g_GuestControlSvcClientID, uNumParms);
                     break;
 
Index: unk/src/VBox/Additions/common/VBoxService/VBoxServiceControlDir.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlDir.cpp	(revision 38132)
+++ 	(revision )
@@ -1,90 +1,0 @@
-/* $Id$ */
-/** @file
- * VBoxServiceControlDir - Utility functions for guest directory handling.
- */
-
-/*
- * Copyright (C) 2011 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-
-/*******************************************************************************
-*   Header Files                                                               *
-*******************************************************************************/
-#include <iprt/assert.h>
-#include <VBox/VBoxGuestLib.h>
-#include <VBox/HostServices/GuestControlSvc.h>
-
-#include "VBoxServiceInternal.h"
-#include "VBoxServiceUtils.h"
-
-using namespace guestControl;
-
-int VBoxServiceGCtrlDirClose(uint32_t u32ClientId, uint32_t uNumParms)
-{
-    uint32_t uContextID;
-    uint32_t uHandle;
-
-    int rc = VbglR3GuestCtrlGetCmdDirClose(u32ClientId, uNumParms,
-                                           &uContextID, &uHandle);
-    if (RT_SUCCESS(rc))
-    {
-
-    }
-    else
-        VBoxServiceError(" VBoxServiceGCtrlDir: Failed to retrieve close command! Error: %Rrc\n", rc);
-    VBoxServiceVerbose(3, " VBoxServiceGCtrlDir: VBoxServiceGCtrlDirClose returned with %Rrc\n", rc);
-    return rc;
-}
-
-int VBoxServiceGCtrlDirOpen(uint32_t u32ClientId, uint32_t uNumParms)
-{
-    uint32_t uContextID;
-    char szDir[_1K];
-    char szFilter[_1K];
-    uint32_t uFlags;
-    char szUser[128];
-    char szPassword[128];
-
-    int rc = VbglR3GuestCtrlGetCmdDirOpen(u32ClientId, uNumParms,
-                                          &uContextID,
-                                          szDir, sizeof(szDir),
-                                          szFilter, sizeof(szFilter),
-                                          &uFlags,
-                                          szUser, sizeof(szUser),
-                                          szPassword, sizeof(szPassword));
-    if (RT_SUCCESS(rc))
-    {
-
-    }
-    else
-        VBoxServiceError(" VBoxServiceGCtrlDir: Failed to retrieve open command! Error: %Rrc\n", rc);
-    VBoxServiceVerbose(3, " VBoxServiceGCtrlDir: VBoxServiceGCtrlDirOpen returned with %Rrc\n", rc);
-    return rc;
-}
-
-int VBoxServiceGCtrlDirRead(uint32_t u32ClientId, uint32_t uNumParms)
-{
-    uint32_t uContextID;
-    uint32_t uHandle;
-
-    int rc = VbglR3GuestCtrlGetCmdDirRead(u32ClientId, uNumParms,
-                                          &uContextID, &uHandle);
-    if (RT_SUCCESS(rc))
-    {
-
-    }
-    else
-        VBoxServiceError(" VBoxServiceGCtrlDir: Failed to retrieve read command! Error: %Rrc\n", rc);
-    VBoxServiceVerbose(3, " VBoxServiceGCtrlDir: VBoxServiceGCtrlDirRead returned with %Rrc\n", rc);
-    return rc;
-}
-
Index: /trunk/src/VBox/HostServices/GuestControl/service.cpp
===================================================================
--- /trunk/src/VBox/HostServices/GuestControl/service.cpp	(revision 38132)
+++ /trunk/src/VBox/HostServices/GuestControl/service.cpp	(revision 38133)
@@ -762,31 +762,4 @@
                                   (void *)(&data), sizeof(data));
     }
-    else if (   eFunction == GUEST_DIR_SEND_OPEN
-             && cParms    == 2)
-    {
-        CALLBACKDATADIROPEN data;
-        data.hdr.u32Magic = CALLBACKDATAMAGIC_DIR_OPEN;
-        paParms[0].getUInt32(&data.hdr.u32ContextID);
-
-        paParms[1].getUInt32(&data.u32Handle);
-
-        if (mpfnHostCallback)
-            rc = mpfnHostCallback(mpvHostData, eFunction,
-                                  (void *)(&data), sizeof(data));
-    }
-    else if (   eFunction == GUEST_DIR_SEND_READ
-             && cParms    == 3)
-    {
-        CALLBACKDATADIRREAD data;
-        data.hdr.u32Magic = CALLBACKDATAMAGIC_DIR_READ;
-        paParms[0].getUInt32(&data.hdr.u32ContextID);
-
-        paParms[1].getUInt64(&data.u64NodeId);
-        paParms[2].getString(&data.pszName, &data.cbName);
-
-        if (mpfnHostCallback)
-            rc = mpfnHostCallback(mpvHostData, eFunction,
-                                  (void *)(&data), sizeof(data));
-    }
     else
         rc = VERR_NOT_SUPPORTED;
Index: /trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp	(revision 38132)
+++ /trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp	(revision 38133)
@@ -3387,4 +3387,8 @@
          */
 
+        /* We need to get output which is machine-readable in form
+         * of "key=value\0..key=value\0\0". */
+        args.push_back(Bstr("--machinereadable").raw());
+
         /* Only the actual file name to chekc is needed for now. */
         args.push_back(Bstr(Utf8File).raw());
@@ -3548,5 +3552,5 @@
                             {
                                 rc = this->GetProcessOutput(uPID, ProcessOutputFlag_None,
-                                                            30 * 1000 /* Timeout in ms */,
+                                                            10 * 1000 /* Timeout in ms */,
                                                             _64K, ComSafeArrayAsOutParam(aOutputData));
                                 /** @todo Do stream header validation! */
@@ -3557,7 +3561,8 @@
                                     if (RT_UNLIKELY(RT_FAILURE(vrc)))
                                         rc = setError(VBOX_E_IPRT_ERROR,
-                                                      tr("Error while adding guest output to stream buffer (%Rrc)"), vrc);
+                                                      tr("Query file size: Error while adding guest output to stream buffer for file \"%s\" (%Rrc)"),
+                                                      Utf8File.c_str(), vrc);
                                 }
-                                else
+                                else /* No more output! */
                                     break;
                             }
@@ -3575,14 +3580,16 @@
                                     else
                                         rc = setError(VBOX_E_IPRT_ERROR,
-                                                      tr("Unable to retrieve file size (%Rrc)"), vrc);
+                                                      tr("Query file size: Unable to retrieve file size for file \"%s\" (%Rrc)"),
+                                                      Utf8File.c_str(), vrc);
                                 }
                                 else
                                     rc = setError(VBOX_E_IPRT_ERROR,
-                                                  tr("Error while parsing guest output (%Rrc)"), vrc);
+                                                  tr("Query file size: Error while parsing guest output for file \"%s\" (%Rrc)"),
+                                                  Utf8File.c_str(), vrc);
                             }
                         }
                         else
                             rc = setError(VBOX_E_IPRT_ERROR,
-                                          tr("Error querying file size for file \"%s\" (exit code %u)"),
+                                          tr("Query file size: Error querying file size for file \"%s\" (exit code %u)"),
                                           Utf8File.c_str(), uRetExitCode);
                     }
@@ -3591,7 +3598,7 @@
             else if (fCanceled)
                 rc = setError(VBOX_E_IPRT_ERROR,
-                              tr("Checking for file existence was aborted"));
+                              tr("Query file size: Checking for file size was aborted"));
             else
-                AssertReleaseMsgFailed(("Checking for file existence neither completed nor canceled!?\n"));
+                AssertReleaseMsgFailed(("Checking for file size neither completed nor canceled!?\n"));
         }
     }
