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
297e4ae7
Commit
297e4ae7
authored
Feb 08, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl/tests: Expand tests for device and interface naming.
parent
d05b88dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
6 deletions
+38
-6
driver_pnp.c
dlls/ntoskrnl.exe/tests/driver_pnp.c
+21
-1
ntoskrnl.c
dlls/ntoskrnl.exe/tests/ntoskrnl.c
+17
-5
No files found.
dlls/ntoskrnl.exe/tests/driver_pnp.c
View file @
297e4ae7
...
...
@@ -34,6 +34,19 @@
#include "driver.h"
#include "utils.h"
/* memcmp() isn't exported from ntoskrnl on i386 */
static
int
kmemcmp
(
const
void
*
ptr1
,
const
void
*
ptr2
,
size_t
n
)
{
const
unsigned
char
*
p1
,
*
p2
;
for
(
p1
=
ptr1
,
p2
=
ptr2
;
n
;
n
--
,
p1
++
,
p2
++
)
{
if
(
*
p1
<
*
p2
)
return
-
1
;
if
(
*
p1
>
*
p2
)
return
1
;
}
return
0
;
}
static
const
GUID
bus_class
=
{
0xdeadbeef
,
0x29ef
,
0x4538
,
{
0xa5
,
0xfd
,
0xb6
,
0x95
,
0x73
,
0xa3
,
0x62
,
0xc1
}};
static
const
GUID
child_class
=
{
0xdeadbeef
,
0x29ef
,
0x4538
,
{
0xa5
,
0xfd
,
0xb6
,
0x95
,
0x73
,
0xa3
,
0x62
,
0xc2
}};
static
UNICODE_STRING
control_symlink
,
bus_symlink
;
...
...
@@ -178,7 +191,7 @@ static NTSTATUS fdo_pnp(IRP *irp)
static
NTSTATUS
query_id
(
struct
device
*
device
,
IRP
*
irp
,
BUS_QUERY_ID_TYPE
type
)
{
static
const
WCHAR
device_id
[]
=
L"
wine
\\
t
est"
;
static
const
WCHAR
device_id
[]
=
L"
Wine
\\
T
est"
;
WCHAR
*
id
=
NULL
;
irp
->
IoStatus
.
Information
=
0
;
...
...
@@ -256,6 +269,7 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device_obj, IRP *irp)
case
IRP_MN_START_DEVICE
:
{
static
const
WCHAR
expect_symlink
[]
=
L"
\\
??
\\
Wine#Test#1#{deadbeef-29ef-4538-a5fd-b69573a362c2}"
;
static
const
LARGE_INTEGER
wait_time
=
{.
QuadPart
=
-
500
*
10000
};
POWER_STATE
state
=
{.
DeviceState
=
PowerDeviceD0
};
NTSTATUS
status
;
...
...
@@ -267,6 +281,12 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device_obj, IRP *irp)
status
=
IoRegisterDeviceInterface
(
device_obj
,
&
child_class
,
NULL
,
&
device
->
child_symlink
);
ok
(
!
status
,
"Failed to register interface, status %#lx.
\n
"
,
status
);
ok
(
device
->
child_symlink
.
Length
==
sizeof
(
expect_symlink
)
-
sizeof
(
WCHAR
),
"Got length %u.
\n
"
,
device
->
child_symlink
.
Length
);
ok
(
device
->
child_symlink
.
MaximumLength
==
sizeof
(
expect_symlink
),
"Got maximum length %u.
\n
"
,
device
->
child_symlink
.
MaximumLength
);
todo_wine
ok
(
!
kmemcmp
(
device
->
child_symlink
.
Buffer
,
expect_symlink
,
device
->
child_symlink
.
MaximumLength
),
"Got symlink
\"
%ls
\"
.
\n
"
,
device
->
child_symlink
.
Buffer
);
IoSetDeviceInterfaceState
(
&
device
->
child_symlink
,
TRUE
);
...
...
dlls/ntoskrnl.exe/tests/ntoskrnl.c
View file @
297e4ae7
...
...
@@ -1406,7 +1406,7 @@ static LRESULT WINAPI device_notify_proc(HWND window, UINT message, WPARAM wpara
else
if
(
IsEqualGUID
(
&
iface
->
dbcc_classguid
,
&
child_class
))
{
++
got_child_arrival
;
todo_wine
ok
(
!
strcmp
(
iface
->
dbcc_name
,
"
\\\\
?
\\
wine#t
est#1#{deadbeef-29ef-4538-a5fd-b69573a362c2}"
),
todo_wine
ok
(
!
strcmp
(
iface
->
dbcc_name
,
"
\\\\
?
\\
Wine#T
est#1#{deadbeef-29ef-4538-a5fd-b69573a362c2}"
),
"got name %s
\n
"
,
debugstr_a
(
iface
->
dbcc_name
));
}
break
;
...
...
@@ -1434,7 +1434,7 @@ static LRESULT WINAPI device_notify_proc(HWND window, UINT message, WPARAM wpara
else
if
(
IsEqualGUID
(
&
iface
->
dbcc_classguid
,
&
child_class
))
{
++
got_child_removal
;
todo_wine
ok
(
!
strcmp
(
iface
->
dbcc_name
,
"
\\\\
?
\\
wine#t
est#1#{deadbeef-29ef-4538-a5fd-b69573a362c2}"
),
todo_wine
ok
(
!
strcmp
(
iface
->
dbcc_name
,
"
\\\\
?
\\
Wine#T
est#1#{deadbeef-29ef-4538-a5fd-b69573a362c2}"
),
"got name %s
\n
"
,
debugstr_a
(
iface
->
dbcc_name
));
}
break
;
...
...
@@ -1506,7 +1506,7 @@ static void test_pnp_devices(void)
ret
=
SetupDiGetDeviceInstanceIdA
(
set
,
&
device
,
buffer
,
sizeof
(
buffer
),
NULL
);
ok
(
ret
,
"failed to get device ID, error %#lx
\n
"
,
GetLastError
());
ok
(
!
strc
asecmp
(
buffer
,
"root
\\
winetest
\\
0"
),
"got ID %s
\n
"
,
debugstr_a
(
buffer
));
ok
(
!
strc
mp
(
buffer
,
"ROOT
\\
WINETEST
\\
0"
),
"got ID %s
\n
"
,
debugstr_a
(
buffer
));
ret
=
SetupDiEnumDeviceInterfaces
(
set
,
NULL
,
&
control_class
,
0
,
&
iface
);
ok
(
ret
,
"failed to get interface, error %#lx
\n
"
,
GetLastError
());
...
...
@@ -1517,7 +1517,7 @@ static void test_pnp_devices(void)
iface_detail
->
cbSize
=
sizeof
(
*
iface_detail
);
ret
=
SetupDiGetDeviceInterfaceDetailA
(
set
,
&
iface
,
iface_detail
,
sizeof
(
buffer
),
NULL
,
NULL
);
ok
(
ret
,
"failed to get interface path, error %#lx
\n
"
,
GetLastError
());
ok
(
!
strc
asec
mp
(
iface_detail
->
DevicePath
,
"
\\\\
?
\\
root#winetest#0#{deadbeef-29ef-4538-a5fd-b69573a362c0}"
),
ok
(
!
strcmp
(
iface_detail
->
DevicePath
,
"
\\\\
?
\\
root#winetest#0#{deadbeef-29ef-4538-a5fd-b69573a362c0}"
),
"wrong path %s
\n
"
,
debugstr_a
(
iface_detail
->
DevicePath
));
SetupDiDestroyDeviceInfoList
(
set
);
...
...
@@ -1614,7 +1614,7 @@ static void test_pnp_devices(void)
ret
=
SetupDiGetDeviceInstanceIdA
(
set
,
&
device
,
buffer
,
sizeof
(
buffer
),
NULL
);
ok
(
ret
,
"failed to get device ID, error %#lx
\n
"
,
GetLastError
());
ok
(
!
strc
asecmp
(
buffer
,
"wine
\\
test
\\
1"
),
"got ID %s
\n
"
,
debugstr_a
(
buffer
));
ok
(
!
strc
mp
(
buffer
,
"WINE
\\
TEST
\\
1"
),
"got ID %s
\n
"
,
debugstr_a
(
buffer
));
ret
=
SetupDiGetDeviceRegistryPropertyA
(
set
,
&
device
,
SPDRP_CAPABILITIES
,
&
type
,
(
BYTE
*
)
&
dword
,
sizeof
(
dword
),
NULL
);
...
...
@@ -1680,6 +1680,18 @@ static void test_pnp_devices(void)
ok
(
!
strcmp
(
buffer
,
"
\\
Device
\\
winetest_pnp_1"
),
"got PDO name %s
\n
"
,
debugstr_a
(
buffer
));
}
ret
=
SetupDiEnumDeviceInterfaces
(
set
,
NULL
,
&
child_class
,
0
,
&
iface
);
ok
(
ret
,
"failed to get interface, error %#lx
\n
"
,
GetLastError
());
ok
(
IsEqualGUID
(
&
iface
.
InterfaceClassGuid
,
&
child_class
),
"wrong class %s
\n
"
,
debugstr_guid
(
&
iface
.
InterfaceClassGuid
));
ok
(
iface
.
Flags
==
SPINT_ACTIVE
,
"got flags %#lx
\n
"
,
iface
.
Flags
);
iface_detail
->
cbSize
=
sizeof
(
*
iface_detail
);
ret
=
SetupDiGetDeviceInterfaceDetailA
(
set
,
&
iface
,
iface_detail
,
sizeof
(
buffer
),
NULL
,
NULL
);
ok
(
ret
,
"failed to get interface path, error %#lx
\n
"
,
GetLastError
());
ok
(
!
strcmp
(
iface_detail
->
DevicePath
,
"
\\\\
?
\\
wine#test#1#{deadbeef-29ef-4538-a5fd-b69573a362c2}"
),
"wrong path %s
\n
"
,
debugstr_a
(
iface_detail
->
DevicePath
));
SetupDiDestroyDeviceInfoList
(
set
);
RtlInitUnicodeString
(
&
string
,
L"
\\
Device
\\
winetest_pnp_1"
);
...
...
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