Alexandre Julliard : winetest: Refuse to run if the mount manager isn' t running.

Alexandre Julliard julliard at winehq.org
Thu Jan 28 11:15:38 CST 2010


Module: wine
Branch: master
Commit: ee0f4b0da39185637c075eae47a5f462c25767b4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ee0f4b0da39185637c075eae47a5f462c25767b4

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jan 28 15:50:52 2010 +0100

winetest: Refuse to run if the mount manager isn't running.

This usually indicates that the Wine prefix isn't valid.

---

 programs/winetest/main.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index bb68ed1..69b7da6 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -132,6 +132,18 @@ static int running_under_wine (void)
     return (GetProcAddress(module, "wine_server_call") != NULL);
 }
 
+static int check_mount_mgr(void)
+{
+    if (running_under_wine())
+    {
+        HANDLE handle = CreateFileA( "\\\\.\\MountPointManager", GENERIC_READ,
+                                     FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0 );
+        if (handle == INVALID_HANDLE_VALUE) return FALSE;
+        CloseHandle( handle );
+    }
+    return TRUE;
+}
+
 static int running_on_visible_desktop (void)
 {
     HWND desktop;
@@ -1021,6 +1033,9 @@ int main( int argc, char *argv[] )
         if (!running_on_visible_desktop ())
             report (R_FATAL, "Tests must be run on a visible desktop");
 
+        if (!check_mount_mgr())
+            report (R_FATAL, "Mount manager not running, most likely your WINEPREFIX wasn't created correctly");
+
         SetConsoleCtrlHandler(ctrl_handler, TRUE);
 
         if (reset_env)




More information about the wine-cvs mailing list