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

This usually indicates that the Wine prefix isn't valid.
This commit is contained in:
Alexandre Julliard 2010-01-28 15:50:52 +01:00
parent 0d16965832
commit ee0f4b0da3
1 changed files with 15 additions and 0 deletions

View File

@ -132,6 +132,18 @@ static int running_under_wine (void)
return (GetProcAddress(module, "wine_server_call") != NULL); 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) static int running_on_visible_desktop (void)
{ {
HWND desktop; HWND desktop;
@ -1021,6 +1033,9 @@ int main( int argc, char *argv[] )
if (!running_on_visible_desktop ()) if (!running_on_visible_desktop ())
report (R_FATAL, "Tests must be run on a 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); SetConsoleCtrlHandler(ctrl_handler, TRUE);
if (reset_env) if (reset_env)