Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1d1ebeff
Commit
1d1ebeff
authored
Oct 03, 2011
by
Francois Gouget
Committed by
Alexandre Julliard
Oct 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Better check the NT path returned by QueryFullProcessImageName().
parent
80ba9f35
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
9 deletions
+29
-9
process.c
dlls/kernel32/tests/process.c
+29
-9
No files found.
dlls/kernel32/tests/process.c
View file @
1d1ebeff
...
...
@@ -1739,10 +1739,10 @@ static void test_QueryFullProcessImageNameA(void)
static
void
test_QueryFullProcessImageNameW
(
void
)
{
HANDLE
hSelf
;
WCHAR
module_name
[
1024
];
WCHAR
module_name
[
1024
]
,
device
[
1024
]
;
WCHAR
deviceW
[]
=
{
'\\'
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
0
};
WCHAR
buf
[
1024
];
DWORD
size
;
DWORD
size
,
len
;
if
(
!
pQueryFullProcessImageNameW
)
{
...
...
@@ -1787,13 +1787,6 @@ static void test_QueryFullProcessImageNameW(void)
expect_eq_d
(
0
,
size
);
expect_eq_d
(
ERROR_INSUFFICIENT_BUFFER
,
GetLastError
());
/* native path */
size
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
expect_eq_d
(
TRUE
,
pQueryFullProcessImageNameW
(
hSelf
,
PROCESS_NAME_NATIVE
,
buf
,
&
size
));
expect_eq_d
(
lstrlenW
(
buf
),
size
);
ok
(
buf
[
0
]
==
'\\'
,
"NT path should begin with '
\\
'
\n
"
);
todo_wine
ok
(
memcmp
(
buf
,
deviceW
,
sizeof
(
WCHAR
)
*
lstrlenW
(
deviceW
))
==
0
,
"NT path should begin with
\\
Device
\n
"
);
/* Buffer too small */
size
=
lstrlenW
(
module_name
)
/
2
;
SetLastError
(
0xdeadbeef
);
...
...
@@ -1803,6 +1796,33 @@ static void test_QueryFullProcessImageNameW(void)
expect_eq_d
(
ERROR_INSUFFICIENT_BUFFER
,
GetLastError
());
expect_eq_ws_i
(
module_name
,
buf
);
/* buffer not changed */
/* native path */
size
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
expect_eq_d
(
TRUE
,
pQueryFullProcessImageNameW
(
hSelf
,
PROCESS_NAME_NATIVE
,
buf
,
&
size
));
expect_eq_d
(
lstrlenW
(
buf
),
size
);
ok
(
buf
[
0
]
==
'\\'
,
"NT path should begin with '
\\
'
\n
"
);
todo_wine
ok
(
memcmp
(
buf
,
deviceW
,
sizeof
(
WCHAR
)
*
lstrlenW
(
deviceW
))
==
0
,
"NT path should begin with
\\
Device
\n
"
);
module_name
[
2
]
=
'\0'
;
*
device
=
'\0'
;
size
=
QueryDosDeviceW
(
module_name
,
device
,
sizeof
(
device
));
ok
(
size
,
"QueryDosDeviceW failed: le=%u
\n
"
,
GetLastError
());
len
=
lstrlenW
(
device
);
ok
(
size
>=
len
+
2
,
"expected %d to be greater than %d+2 = strlen(%s)
\n
"
,
size
,
len
,
wine_dbgstr_w
(
device
));
if
(
size
>=
lstrlenW
(
buf
))
{
ok
(
0
,
"expected %s
\\
to match the start of %s
\n
"
,
wine_dbgstr_w
(
device
),
wine_dbgstr_w
(
buf
));
}
else
{
todo_wine
ok
(
buf
[
len
]
==
'\\'
,
"expected '%c' to be a '
\\
' in %s
\n
"
,
buf
[
len
],
wine_dbgstr_w
(
module_name
));
buf
[
len
]
=
'\0'
;
todo_wine
ok
(
lstrcmpiW
(
device
,
buf
)
==
0
,
"expected %s to match %s
\n
"
,
wine_dbgstr_w
(
device
),
wine_dbgstr_w
(
buf
));
todo_wine
ok
(
lstrcmpiW
(
module_name
+
3
,
buf
+
len
+
1
)
==
0
,
"expected '%s' to match '%s'
\n
"
,
wine_dbgstr_w
(
module_name
+
3
),
wine_dbgstr_w
(
buf
+
len
+
1
));
}
CloseHandle
(
hSelf
);
}
...
...
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