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
c6aa40a7
Commit
c6aa40a7
authored
Mar 24, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl/tests: Use WCHAR file paths.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5e6b46f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
ntoskrnl.c
dlls/ntoskrnl.exe/tests/ntoskrnl.c
+24
-24
No files found.
dlls/ntoskrnl.exe/tests/ntoskrnl.c
View file @
c6aa40a7
...
...
@@ -40,21 +40,21 @@ static BOOL (WINAPI *pRtlFreeUnicodeString)(UNICODE_STRING *);
static
BOOL
(
WINAPI
*
pCancelIoEx
)(
HANDLE
,
OVERLAPPED
*
);
static
BOOL
(
WINAPI
*
pSetFileCompletionNotificationModes
)(
HANDLE
,
UCHAR
);
static
void
load_resource
(
const
char
*
name
,
char
*
filename
)
static
void
load_resource
(
const
WCHAR
*
name
,
WCHAR
*
filename
)
{
static
char
path
[
MAX_PATH
];
static
WCHAR
path
[
MAX_PATH
];
DWORD
written
;
HANDLE
file
;
HRSRC
res
;
void
*
ptr
;
GetTempPath
A
(
sizeof
(
path
),
path
);
GetTempFileName
A
(
path
,
name
,
0
,
filename
);
GetTempPath
W
(
ARRAY_SIZE
(
path
),
path
);
GetTempFileName
W
(
path
,
name
,
0
,
filename
);
file
=
CreateFile
A
(
filename
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"f
ile creation failed, at %s, error %d
\n
"
,
filename
,
GetLastError
());
file
=
CreateFile
W
(
filename
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"f
ailed to create %s, error %u
\n
"
,
debugstr_w
(
filename
)
,
GetLastError
());
res
=
FindResource
A
(
NULL
,
name
,
"TESTDLL"
);
res
=
FindResource
W
(
NULL
,
name
,
L
"TESTDLL"
);
ok
(
res
!=
0
,
"couldn't find resource
\n
"
);
ptr
=
LockResource
(
LoadResource
(
GetModuleHandleA
(
NULL
),
res
));
WriteFile
(
file
,
ptr
,
SizeofResource
(
GetModuleHandleA
(
NULL
),
res
),
&
written
,
NULL
);
...
...
@@ -81,7 +81,7 @@ static void unload_driver(SC_HANDLE service)
CloseServiceHandle
(
service
);
}
static
SC_HANDLE
load_driver
(
char
*
filename
,
const
char
*
resname
,
const
char
*
driver_name
)
static
SC_HANDLE
load_driver
(
WCHAR
*
filename
,
const
WCHAR
*
resname
,
const
WCHAR
*
driver_name
)
{
SC_HANDLE
manager
,
service
;
...
...
@@ -94,13 +94,13 @@ static SC_HANDLE load_driver(char *filename, const char *resname, const char *dr
ok
(
!!
manager
,
"OpenSCManager failed
\n
"
);
/* stop any old drivers running under this name */
service
=
OpenService
A
(
manager
,
driver_name
,
SERVICE_ALL_ACCESS
);
service
=
OpenService
W
(
manager
,
driver_name
,
SERVICE_ALL_ACCESS
);
if
(
service
)
unload_driver
(
service
);
load_resource
(
resname
,
filename
);
trace
(
"Trying to load driver %s
\n
"
,
filename
);
trace
(
"Trying to load driver %s
\n
"
,
debugstr_w
(
filename
)
);
service
=
CreateService
A
(
manager
,
driver_name
,
driver_name
,
service
=
CreateService
W
(
manager
,
driver_name
,
driver_name
,
SERVICE_ALL_ACCESS
,
SERVICE_KERNEL_DRIVER
,
SERVICE_DEMAND_START
,
SERVICE_ERROR_NORMAL
,
filename
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
...
...
@@ -618,11 +618,11 @@ static void test_object_info(void)
static
void
test_driver3
(
void
)
{
char
filename
[
MAX_PATH
];
WCHAR
filename
[
MAX_PATH
];
SC_HANDLE
service
;
BOOL
ret
;
service
=
load_driver
(
filename
,
"driver3.dll"
,
"WineTestDriver3"
);
service
=
load_driver
(
filename
,
L"driver3.dll"
,
L
"WineTestDriver3"
);
ok
(
service
!=
NULL
,
"driver3 failed to load
\n
"
);
ret
=
StartServiceA
(
service
,
0
,
NULL
);
...
...
@@ -634,7 +634,7 @@ static void test_driver3(void)
DeleteService
(
service
);
CloseServiceHandle
(
service
);
DeleteFile
A
(
filename
);
DeleteFile
W
(
filename
);
}
static
DWORD
WINAPI
wsk_test_thread
(
void
*
parameter
)
...
...
@@ -698,18 +698,18 @@ static DWORD WINAPI wsk_test_thread(void *parameter)
static
void
test_driver4
(
void
)
{
char
filename
[
MAX_PATH
];
WCHAR
filename
[
MAX_PATH
];
SC_HANDLE
service
;
HANDLE
hthread
;
DWORD
written
;
BOOL
ret
;
if
(
!
(
service
=
load_driver
(
filename
,
"driver4.dll"
,
"WineTestDriver4"
)))
if
(
!
(
service
=
load_driver
(
filename
,
L"driver4.dll"
,
L
"WineTestDriver4"
)))
return
;
if
(
!
start_driver
(
service
,
TRUE
))
{
DeleteFile
A
(
filename
);
DeleteFile
W
(
filename
);
return
;
}
...
...
@@ -726,13 +726,13 @@ static void test_driver4(void)
CloseHandle
(
device
);
unload_driver
(
service
);
ret
=
DeleteFile
A
(
filename
);
ret
=
DeleteFile
W
(
filename
);
ok
(
ret
,
"DeleteFile failed: %u
\n
"
,
GetLastError
());
}
START_TEST
(
ntoskrnl
)
{
char
filename
[
MAX_PATH
],
filename2
[
MAX_PATH
];
WCHAR
filename
[
MAX_PATH
],
filename2
[
MAX_PATH
];
SC_HANDLE
service
,
service2
;
DWORD
written
;
BOOL
ret
;
...
...
@@ -745,14 +745,14 @@ START_TEST(ntoskrnl)
"SetFileCompletionNotificationModes"
);
subtest
(
"driver"
);
if
(
!
(
service
=
load_driver
(
filename
,
"driver.dll"
,
"WineTestDriver"
)))
if
(
!
(
service
=
load_driver
(
filename
,
L"driver.dll"
,
L
"WineTestDriver"
)))
return
;
if
(
!
start_driver
(
service
,
FALSE
))
{
DeleteFile
A
(
filename
);
DeleteFile
W
(
filename
);
return
;
}
service2
=
load_driver
(
filename2
,
"driver2.dll"
,
"WineTestDriver2"
);
service2
=
load_driver
(
filename2
,
L"driver2.dll"
,
L
"WineTestDriver2"
);
device
=
CreateFileA
(
"
\\\\
.
\\
WineTestDriver"
,
0
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
ok
(
device
!=
INVALID_HANDLE_VALUE
,
"failed to open device: %u
\n
"
,
GetLastError
());
...
...
@@ -778,9 +778,9 @@ START_TEST(ntoskrnl)
unload_driver
(
service2
);
unload_driver
(
service
);
ret
=
DeleteFile
A
(
filename
);
ret
=
DeleteFile
W
(
filename
);
ok
(
ret
,
"DeleteFile failed: %u
\n
"
,
GetLastError
());
ret
=
DeleteFile
A
(
filename2
);
ret
=
DeleteFile
W
(
filename2
);
ok
(
ret
,
"DeleteFile failed: %u
\n
"
,
GetLastError
());
test_driver3
();
...
...
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