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
2bd9c59c
Commit
2bd9c59c
authored
Aug 15, 2006
by
Paul Vriens
Committed by
Alexandre Julliard
Aug 15, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Make tests loadable again on NT4.
parent
c73e577c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
5 deletions
+27
-5
devinst.c
dlls/setupapi/tests/devinst.c
+27
-5
No files found.
dlls/setupapi/tests/devinst.c
View file @
2bd9c59c
...
...
@@ -30,6 +30,21 @@
#include "wine/test.h"
/* function pointers */
static
HMODULE
hSetupAPI
;
static
HDEVINFO
(
WINAPI
*
pSetupDiCreateDeviceInfoListExW
)(
GUID
*
,
HWND
,
PCWSTR
,
PVOID
);
static
BOOL
(
WINAPI
*
pSetupDiDestroyDeviceInfoList
)(
HDEVINFO
);
static
void
init_function_pointers
(
void
)
{
hSetupAPI
=
LoadLibraryA
(
"setupapi.dll"
);
if
(
hSetupAPI
)
{
pSetupDiCreateDeviceInfoListExW
=
(
void
*
)
GetProcAddress
(
hSetupAPI
,
"SetupDiCreateDeviceInfoListExW"
);
pSetupDiDestroyDeviceInfoList
=
(
void
*
)
GetProcAddress
(
hSetupAPI
,
"SetupDiDestroyDeviceInfoList"
);
}
}
static
void
test_SetupDiCreateDeviceInfoListEx
(
void
)
{
...
...
@@ -41,7 +56,7 @@ static void test_SetupDiCreateDeviceInfoListEx(void)
SetLastError
(
0xdeadbeef
);
/* create empty DeviceInfoList, but set Reserved to a value, which is not NULL */
devlist
=
SetupDiCreateDeviceInfoListExW
(
NULL
,
NULL
,
NULL
,
notnull
);
devlist
=
p
SetupDiCreateDeviceInfoListExW
(
NULL
,
NULL
,
NULL
,
notnull
);
error
=
GetLastError
();
ok
(
devlist
==
INVALID_HANDLE_VALUE
,
"SetupDiCreateDeviceInfoListExW failed : %p %ld (expected %p)
\n
"
,
devlist
,
error
,
INVALID_HANDLE_VALUE
);
...
...
@@ -49,22 +64,29 @@ static void test_SetupDiCreateDeviceInfoListEx(void)
SetLastError
(
0xdeadbeef
);
/* create empty DeviceInfoList, but set MachineName to something */
devlist
=
SetupDiCreateDeviceInfoListExW
(
NULL
,
NULL
,
machine
,
NULL
);
devlist
=
p
SetupDiCreateDeviceInfoListExW
(
NULL
,
NULL
,
machine
,
NULL
);
error
=
GetLastError
();
ok
(
devlist
==
INVALID_HANDLE_VALUE
,
"SetupDiCreateDeviceInfoListExW failed : %p %ld (expected %p)
\n
"
,
devlist
,
error
,
INVALID_HANDLE_VALUE
);
ok
(
error
==
ERROR_INVALID_MACHINENAME
,
"GetLastError returned wrong value : %ld, (expected %d)
\n
"
,
error
,
ERROR_INVALID_MACHINENAME
);
/* create empty DeviceInfoList */
devlist
=
SetupDiCreateDeviceInfoListExW
(
NULL
,
NULL
,
NULL
,
NULL
);
devlist
=
p
SetupDiCreateDeviceInfoListExW
(
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
devlist
&&
devlist
!=
INVALID_HANDLE_VALUE
,
"SetupDiCreateDeviceInfoListExW failed : %p %ld (expected != %p)
\n
"
,
devlist
,
error
,
INVALID_HANDLE_VALUE
);
/* destroy DeviceInfoList */
ret
=
SetupDiDestroyDeviceInfoList
(
devlist
);
ret
=
p
SetupDiDestroyDeviceInfoList
(
devlist
);
ok
(
ret
,
"SetupDiDestroyDeviceInfoList failed : %ld
\n
"
,
error
);
}
START_TEST
(
devinst
)
{
test_SetupDiCreateDeviceInfoListEx
();
init_function_pointers
();
if
(
!
hSetupAPI
)
return
;
if
(
pSetupDiCreateDeviceInfoListExW
&&
pSetupDiDestroyDeviceInfoList
)
test_SetupDiCreateDeviceInfoListEx
();
else
trace
(
"Needed calls not all available, skipping tests.
\n
"
);
}
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