Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e45caf5d
Commit
e45caf5d
authored
Jan 28, 2011
by
Greg Geldorp
Committed by
Alexandre Julliard
Jan 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm/tests: Skip some tests on VMware.
parent
6fb10a6e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
1 deletion
+73
-1
Makefile.in
dlls/winmm/tests/Makefile.in
+1
-1
midi.c
dlls/winmm/tests/midi.c
+72
-0
No files found.
dlls/winmm/tests/Makefile.in
View file @
e45caf5d
TESTDLL
=
winmm.dll
IMPORTS
=
winmm user32
IMPORTS
=
winmm user32
advapi32
C_SRCS
=
\
capture.c
\
...
...
dlls/winmm/tests/midi.c
View file @
e45caf5d
...
...
@@ -625,6 +625,72 @@ static void test_midiStream(UINT udev, HWND hwnd)
}
}
static
BOOL
scan_subkeys
(
HKEY
parent
,
const
LPCSTR
*
sub_keys
)
{
char
name
[
64
];
DWORD
index
=
0
;
DWORD
name_len
=
sizeof
(
name
);
BOOL
found_vmware
=
FALSE
;
if
(
sub_keys
[
0
]
==
NULL
)
{
/* We're at the deepest level, check "Identifier" value now */
char
*
test
;
if
(
RegQueryValueExA
(
parent
,
"Identifier"
,
NULL
,
NULL
,
(
LPBYTE
)
name
,
&
name_len
)
!=
ERROR_SUCCESS
)
return
FALSE
;
for
(
test
=
name
;
test
<
name
+
lstrlenA
(
name
)
-
6
&&
!
found_vmware
;
test
++
)
{
char
c
=
test
[
6
];
test
[
6
]
=
'\0'
;
found_vmware
=
(
lstrcmpiA
(
test
,
"VMware"
)
==
0
);
test
[
6
]
=
c
;
}
return
found_vmware
;
}
while
(
RegEnumKeyExA
(
parent
,
index
,
name
,
&
name_len
,
NULL
,
NULL
,
NULL
,
NULL
)
==
ERROR_SUCCESS
&&
!
found_vmware
)
{
char
c
=
name
[
lstrlenA
(
sub_keys
[
0
])];
name
[
lstrlenA
(
sub_keys
[
0
])]
=
'\0'
;
if
(
lstrcmpiA
(
name
,
sub_keys
[
0
])
==
0
)
{
HKEY
sub_key
;
name
[
lstrlenA
(
sub_keys
[
0
])]
=
c
;
if
(
RegOpenKeyExA
(
parent
,
name
,
0
,
KEY_ENUMERATE_SUB_KEYS
|
KEY_QUERY_VALUE
,
&
sub_key
)
==
ERROR_SUCCESS
)
{
found_vmware
=
scan_subkeys
(
sub_key
,
sub_keys
+
1
);
RegCloseKey
(
sub_key
);
}
}
name_len
=
sizeof
(
name
);
index
++
;
}
return
found_vmware
;
}
/*
* Usual method to detect whether running inside a VMware virtual machine involves direct port I/O requiring
* some assembly and an exception handler. Can't do that in Wine tests. Alternative method of querying WMI
* is not available on NT4. So instead we look at the device map and check the Identifier value in the
* registry keys HKLM\HARDWARE\DEVICEMAP\SCSI\Scsi Port x\Scsi Bus x\Target Id x\Logical Unit Id x (where
* x is some number). If the Identifier value contains the string "VMware" we assume running in a VMware VM.
*/
static
BOOL
on_vmware
(
void
)
{
static
const
LPCSTR
sub_keys
[]
=
{
"Scsi Port "
,
"Scsi Bus "
,
"Target Id "
,
"Logical Unit Id "
,
NULL
};
HKEY
scsi
;
BOOL
found_vmware
=
FALSE
;
if
(
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
"HARDWARE
\\
DEVICEMAP
\\
Scsi"
,
0
,
KEY_ENUMERATE_SUB_KEYS
,
&
scsi
)
!=
ERROR_SUCCESS
)
return
FALSE
;
found_vmware
=
scan_subkeys
(
scsi
,
sub_keys
);
RegCloseKey
(
scsi
);
return
found_vmware
;
}
static
void
test_midi_outfns
(
HWND
hwnd
)
{
HMIDIOUT
hm
;
...
...
@@ -662,12 +728,18 @@ static void test_midi_outfns(HWND hwnd)
test_midi_mci
(
hwnd
);
for
(
udev
=
0
;
udev
<
ndevs
;
udev
++
)
{
MIDIOUTCAPSA
capsA
;
rc
=
midiOutGetDevCapsA
(
udev
,
&
capsA
,
sizeof
(
capsA
));
if
(
rc
||
strcmp
(
capsA
.
szPname
,
"Creative Sound Blaster MPU-401"
)
!=
0
||
!
on_vmware
())
{
trace
(
"** Testing device %d
\n
"
,
udev
);
test_midiOut_device
(
udev
,
hwnd
);
Sleep
(
800
);
/* Let the synth rest */
test_midiStream
(
udev
,
hwnd
);
Sleep
(
800
);
}
else
win_skip
(
"Skipping this device on VMware, driver problem
\n
"
);
}
trace
(
"** Testing MIDI mapper
\n
"
);
test_midiOut_device
(
MIDIMAPPER
,
hwnd
);
Sleep
(
800
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment