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
c6083037
Commit
c6083037
authored
Apr 22, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Make sure the string is properly terminated in QueryFullProcessImageNameW.
parent
b485ed23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
process.c
dlls/kernel32/process.c
+6
-3
No files found.
dlls/kernel32/process.c
View file @
c6083037
...
@@ -3158,10 +3158,11 @@ BOOL WINAPI QueryFullProcessImageNameW(HANDLE hProcess, DWORD dwFlags, LPWSTR lp
...
@@ -3158,10 +3158,11 @@ BOOL WINAPI QueryFullProcessImageNameW(HANDLE hProcess, DWORD dwFlags, LPWSTR lp
RtlInitUnicodeStringEx
(
&
nt_path
,
NULL
);
RtlInitUnicodeStringEx
(
&
nt_path
,
NULL
);
/* FIXME: On Windows, ProcessImageFileName return an NT path. We rely that it being a DOS path,
/* FIXME: On Windows, ProcessImageFileName return an NT path. We rely that it being a DOS path,
* as this is on Wine. */
* as this is on Wine. */
status
=
NtQueryInformationProcess
(
hProcess
,
ProcessImageFileName
,
buffer
,
sizeof
(
buffer
),
&
needed
);
status
=
NtQueryInformationProcess
(
hProcess
,
ProcessImageFileName
,
buffer
,
sizeof
(
buffer
)
-
sizeof
(
WCHAR
),
&
needed
);
if
(
status
==
STATUS_INFO_LENGTH_MISMATCH
)
if
(
status
==
STATUS_INFO_LENGTH_MISMATCH
)
{
{
dynamic_buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
needed
);
dynamic_buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
needed
+
sizeof
(
WCHAR
)
);
status
=
NtQueryInformationProcess
(
hProcess
,
ProcessImageFileName
,
(
LPBYTE
)
dynamic_buffer
,
needed
,
&
needed
);
status
=
NtQueryInformationProcess
(
hProcess
,
ProcessImageFileName
,
(
LPBYTE
)
dynamic_buffer
,
needed
,
&
needed
);
result
=
dynamic_buffer
;
result
=
dynamic_buffer
;
}
}
...
@@ -3172,6 +3173,7 @@ BOOL WINAPI QueryFullProcessImageNameW(HANDLE hProcess, DWORD dwFlags, LPWSTR lp
...
@@ -3172,6 +3173,7 @@ BOOL WINAPI QueryFullProcessImageNameW(HANDLE hProcess, DWORD dwFlags, LPWSTR lp
if
(
dwFlags
&
PROCESS_NAME_NATIVE
)
if
(
dwFlags
&
PROCESS_NAME_NATIVE
)
{
{
result
->
Buffer
[
result
->
Length
/
sizeof
(
WCHAR
)]
=
0
;
if
(
!
RtlDosPathNameToNtPathName_U
(
result
->
Buffer
,
&
nt_path
,
NULL
,
NULL
))
if
(
!
RtlDosPathNameToNtPathName_U
(
result
->
Buffer
,
&
nt_path
,
NULL
,
NULL
))
{
{
status
=
STATUS_OBJECT_PATH_NOT_FOUND
;
status
=
STATUS_OBJECT_PATH_NOT_FOUND
;
...
@@ -3186,8 +3188,9 @@ BOOL WINAPI QueryFullProcessImageNameW(HANDLE hProcess, DWORD dwFlags, LPWSTR lp
...
@@ -3186,8 +3188,9 @@ BOOL WINAPI QueryFullProcessImageNameW(HANDLE hProcess, DWORD dwFlags, LPWSTR lp
goto
cleanup
;
goto
cleanup
;
}
}
lstrcpynW
(
lpExeName
,
result
->
Buffer
,
result
->
Length
/
sizeof
(
WCHAR
)
+
1
);
*
pdwSize
=
result
->
Length
/
sizeof
(
WCHAR
);
*
pdwSize
=
result
->
Length
/
sizeof
(
WCHAR
);
memcpy
(
lpExeName
,
result
->
Buffer
,
result
->
Length
);
lpExeName
[
*
pdwSize
]
=
0
;
cleanup
:
cleanup
:
HeapFree
(
GetProcessHeap
(),
0
,
dynamic_buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
dynamic_buffer
);
...
...
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