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
2f254604
Commit
2f254604
authored
Feb 21, 2005
by
Lionel Ulmer
Committed by
Alexandre Julliard
Feb 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement 'W' variants of Process32First / Next APIs
parent
2eacfecd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
14 deletions
+59
-14
kernel32.spec
dlls/kernel/kernel32.spec
+2
-2
toolhelp.c
dlls/kernel/toolhelp.c
+57
-12
No files found.
dlls/kernel/kernel32.spec
View file @
2f254604
...
...
@@ -661,9 +661,9 @@
@ stdcall PrepareTape(ptr long long)
@ stub PrivMoveFileIdentityW
@ stdcall Process32First (ptr ptr)
@ st
ub Process32FirstW
@ st
dcall Process32FirstW (ptr ptr)
@ stdcall Process32Next (ptr ptr)
@ st
ub Process32NextW
@ st
dcall Process32NextW (ptr ptr)
@ stdcall PulseEvent(long)
@ stdcall PurgeComm(long long)
@ stdcall -register -i386 QT_Thunk()
...
...
dlls/kernel/toolhelp.c
View file @
2f254604
...
...
@@ -295,19 +295,33 @@ BOOL WINAPI Thread32Next(HANDLE hSnapshot, LPTHREADENTRY32 lpte)
/***********************************************************************
* TOOLHELP_Process32Next
*
* Implementation of Process32First/Next
* Implementation of Process32First/Next. Note that the ANSI / Unicode
* version check is a bit of a hack as it relies on the fact that only
* the last field is actually different.
*/
static
BOOL
TOOLHELP_Process32Next
(
HANDLE
handle
,
LPPROCESSENTRY32
lppe
,
BOOL
first
)
static
BOOL
TOOLHELP_Process32Next
(
HANDLE
handle
,
LPPROCESSENTRY32
W
lppe
,
BOOL
first
,
BOOL
unicode
)
{
BOOL
ret
;
WCHAR
exe
[
MAX_PATH
];
WCHAR
exe
[
MAX_PATH
-
1
];
DWORD
len
;
if
(
lppe
->
dwSize
<
sizeof
(
PROCESSENTRY32
)
)
if
(
unicode
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
ERR
(
"Result buffer too small (req: %d, was: %ld)
\n
"
,
sizeof
(
PROCESSENTRY32
),
lppe
->
dwSize
);
return
FALSE
;
if
(
lppe
->
dwSize
<
sizeof
(
PROCESSENTRY32W
))
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
ERR
(
"Result buffer too small (req: %d, was: %ld)
\n
"
,
sizeof
(
PROCESSENTRY32W
),
lppe
->
dwSize
);
return
FALSE
;
}
}
else
{
if
(
lppe
->
dwSize
<
sizeof
(
PROCESSENTRY32
))
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
ERR
(
"Result buffer too small (req: %d, was: %ld)
\n
"
,
sizeof
(
PROCESSENTRY32
),
lppe
->
dwSize
);
return
FALSE
;
}
}
SERVER_START_REQ
(
next_process
)
{
...
...
@@ -324,9 +338,20 @@ static BOOL TOOLHELP_Process32Next( HANDLE handle, LPPROCESSENTRY32 lppe, BOOL f
lppe
->
th32ParentProcessID
=
reply
->
ppid
;
lppe
->
pcPriClassBase
=
reply
->
priority
;
lppe
->
dwFlags
=
-
1
;
/* FIXME */
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
exe
,
wine_server_reply_size
(
reply
)
/
sizeof
(
WCHAR
),
lppe
->
szExeFile
,
sizeof
(
lppe
->
szExeFile
),
NULL
,
NULL
);
lppe
->
szExeFile
[
len
]
=
0
;
if
(
unicode
)
{
len
=
wine_server_reply_size
(
reply
)
/
sizeof
(
WCHAR
);
memcpy
(
lppe
->
szExeFile
,
reply
,
wine_server_reply_size
(
reply
));
lppe
->
szExeFile
[
len
]
=
0
;
}
else
{
LPPROCESSENTRY32
lppe_a
=
(
LPPROCESSENTRY32
)
lppe
;
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
exe
,
wine_server_reply_size
(
reply
)
/
sizeof
(
WCHAR
),
lppe_a
->
szExeFile
,
sizeof
(
lppe_a
->
szExeFile
)
-
1
,
NULL
,
NULL
);
lppe_a
->
szExeFile
[
len
]
=
0
;
}
}
}
SERVER_END_REQ
;
...
...
@@ -341,7 +366,7 @@ static BOOL TOOLHELP_Process32Next( HANDLE handle, LPPROCESSENTRY32 lppe, BOOL f
*/
BOOL
WINAPI
Process32First
(
HANDLE
hSnapshot
,
LPPROCESSENTRY32
lppe
)
{
return
TOOLHELP_Process32Next
(
hSnapshot
,
lppe
,
TRUE
);
return
TOOLHELP_Process32Next
(
hSnapshot
,
(
LPPROCESSENTRY32W
)
lppe
,
TRUE
,
FALSE
/* ANSI */
);
}
/***********************************************************************
...
...
@@ -351,7 +376,27 @@ BOOL WINAPI Process32First(HANDLE hSnapshot, LPPROCESSENTRY32 lppe)
*/
BOOL
WINAPI
Process32Next
(
HANDLE
hSnapshot
,
LPPROCESSENTRY32
lppe
)
{
return
TOOLHELP_Process32Next
(
hSnapshot
,
lppe
,
FALSE
);
return
TOOLHELP_Process32Next
(
hSnapshot
,
(
LPPROCESSENTRY32W
)
lppe
,
FALSE
,
FALSE
/* ANSI */
);
}
/***********************************************************************
* Process32FirstW (KERNEL32.@)
*
* Return info about the first process in a toolhelp32 snapshot
*/
BOOL
WINAPI
Process32FirstW
(
HANDLE
hSnapshot
,
LPPROCESSENTRY32W
lppe
)
{
return
TOOLHELP_Process32Next
(
hSnapshot
,
lppe
,
TRUE
,
TRUE
/* Unicode */
);
}
/***********************************************************************
* Process32NextW (KERNEL32.@)
*
* Return info about the "next" process in a toolhelp32 snapshot
*/
BOOL
WINAPI
Process32NextW
(
HANDLE
hSnapshot
,
LPPROCESSENTRY32W
lppe
)
{
return
TOOLHELP_Process32Next
(
hSnapshot
,
lppe
,
FALSE
,
TRUE
/* Unicode */
);
}
...
...
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