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
bfd088db
Commit
bfd088db
authored
Jan 17, 2015
by
Qian Hong
Committed by
Alexandre Julliard
Jan 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fixed buffer size on 64bit in IsWow64Process.
parent
2d08038b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
1 deletion
+58
-1
process.c
dlls/kernel32/process.c
+1
-1
process.c
dlls/kernel32/tests/process.c
+57
-0
No files found.
dlls/kernel32/process.c
View file @
bfd088db
...
...
@@ -3755,7 +3755,7 @@ DWORD WINAPI RegisterServiceProcess(DWORD dwProcessId, DWORD dwType)
*/
BOOL
WINAPI
IsWow64Process
(
HANDLE
hProcess
,
PBOOL
Wow64Process
)
{
ULONG
pbi
;
ULONG
_PTR
pbi
;
NTSTATUS
status
;
status
=
NtQueryInformationProcess
(
hProcess
,
ProcessWow64Information
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
...
...
dlls/kernel32/tests/process.c
View file @
bfd088db
...
...
@@ -1863,6 +1863,62 @@ static void test_Handles(void)
SetStdHandle
(
STD_ERROR_HANDLE
,
handle
);
}
static
void
test_IsWow64Process
(
void
)
{
PROCESS_INFORMATION
pi
;
STARTUPINFOA
si
;
DWORD
ret
;
BOOL
is_wow64
;
static
char
cmdline
[]
=
"C:
\\
Program Files
\\
Internet Explorer
\\
iexplore.exe"
;
static
char
cmdline_wow64
[]
=
"C:
\\
Program Files (x86)
\\
Internet Explorer
\\
iexplore.exe"
;
if
(
!
pIsWow64Process
)
{
skip
(
"IsWow64Process is not available
\n
"
);
return
;
}
memset
(
&
si
,
0
,
sizeof
(
si
));
si
.
cb
=
sizeof
(
si
);
si
.
dwFlags
=
STARTF_USESHOWWINDOW
;
si
.
wShowWindow
=
SW_HIDE
;
ret
=
CreateProcessA
(
NULL
,
cmdline_wow64
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
if
(
ret
)
{
trace
(
"Created process %s
\n
"
,
cmdline_wow64
);
is_wow64
=
FALSE
;
ret
=
pIsWow64Process
(
pi
.
hProcess
,
&
is_wow64
);
ok
(
ret
,
"IsWow64Process failed.
\n
"
);
ok
(
is_wow64
,
"is_wow64 returned FALSE.
\n
"
);
ret
=
TerminateProcess
(
pi
.
hProcess
,
0
);
ok
(
ret
,
"TerminateProcess error
\n
"
);
CloseHandle
(
pi
.
hProcess
);
CloseHandle
(
pi
.
hThread
);
}
memset
(
&
si
,
0
,
sizeof
(
si
));
si
.
cb
=
sizeof
(
si
);
si
.
dwFlags
=
STARTF_USESHOWWINDOW
;
si
.
wShowWindow
=
SW_HIDE
;
ret
=
CreateProcessA
(
NULL
,
cmdline
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
if
(
ret
)
{
trace
(
"Created process %s
\n
"
,
cmdline
);
is_wow64
=
TRUE
;
ret
=
pIsWow64Process
(
pi
.
hProcess
,
&
is_wow64
);
ok
(
ret
,
"IsWow64Process failed.
\n
"
);
ok
(
!
is_wow64
,
"is_wow64 returned TRUE.
\n
"
);
ret
=
TerminateProcess
(
pi
.
hProcess
,
0
);
ok
(
ret
,
"TerminateProcess error
\n
"
);
CloseHandle
(
pi
.
hProcess
);
CloseHandle
(
pi
.
hThread
);
}
}
static
void
test_SystemInfo
(
void
)
{
SYSTEM_INFO
si
,
nsi
;
...
...
@@ -2089,6 +2145,7 @@ START_TEST(process)
test_QueryFullProcessImageNameA
();
test_QueryFullProcessImageNameW
();
test_Handles
();
test_IsWow64Process
();
test_SystemInfo
();
test_RegistryQuota
();
test_DuplicateHandle
();
...
...
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