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
2b7094e4
Commit
2b7094e4
authored
Jun 09, 2005
by
Paul Vriens
Committed by
Alexandre Julliard
Jun 09, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce our buffer by 1 SYSTEM_THREAD_INFORMATION per process.
Minimize some calculations.
parent
c4056230
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
nt.c
dlls/ntdll/nt.c
+7
-8
No files found.
dlls/ntdll/nt.c
View file @
2b7094e4
...
@@ -674,6 +674,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
...
@@ -674,6 +674,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
HANDLE
hSnap
=
0
;
HANDLE
hSnap
=
0
;
WCHAR
procname
[
1024
];
WCHAR
procname
[
1024
];
DWORD
wlen
=
0
;
DWORD
wlen
=
0
;
DWORD
procstructlen
=
0
;
SERVER_START_REQ
(
create_snapshot
)
SERVER_START_REQ
(
create_snapshot
)
{
{
...
@@ -694,7 +695,8 @@ NTSTATUS WINAPI NtQuerySystemInformation(
...
@@ -694,7 +695,8 @@ NTSTATUS WINAPI NtQuerySystemInformation(
if
(
!
(
ret
=
wine_server_call
(
req
)))
if
(
!
(
ret
=
wine_server_call
(
req
)))
{
{
wlen
=
wine_server_reply_size
(
reply
)
+
sizeof
(
WCHAR
);
wlen
=
wine_server_reply_size
(
reply
)
+
sizeof
(
WCHAR
);
if
(
Length
>=
len
+
sizeof
(
*
spi
))
procstructlen
=
sizeof
(
*
spi
)
+
wlen
+
((
reply
->
threads
-
1
)
*
sizeof
(
SYSTEM_THREAD_INFORMATION
));
if
(
Length
>=
len
+
procstructlen
)
{
{
/* ftCreationTime, ftUserTime, ftKernelTime;
/* ftCreationTime, ftUserTime, ftKernelTime;
* vmCounters, ioCounters
* vmCounters, ioCounters
...
@@ -702,7 +704,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
...
@@ -702,7 +704,7 @@ NTSTATUS WINAPI NtQuerySystemInformation(
memset
(
spi
,
0
,
sizeof
(
*
spi
));
memset
(
spi
,
0
,
sizeof
(
*
spi
));
spi
->
dwOffset
=
sizeof
(
*
spi
)
;
spi
->
dwOffset
=
procstructlen
-
wlen
;
spi
->
dwThreadCount
=
reply
->
threads
;
spi
->
dwThreadCount
=
reply
->
threads
;
/* spi->pszProcessName will be set later on */
/* spi->pszProcessName will be set later on */
...
@@ -714,24 +716,23 @@ NTSTATUS WINAPI NtQuerySystemInformation(
...
@@ -714,24 +716,23 @@ NTSTATUS WINAPI NtQuerySystemInformation(
/* spi->ti will be set later on */
/* spi->ti will be set later on */
len
+=
sizeof
(
*
spi
)
-
sizeof
(
spi
->
ti
)
;
len
+=
procstructlen
;
}
}
else
ret
=
STATUS_INFO_LENGTH_MISMATCH
;
else
ret
=
STATUS_INFO_LENGTH_MISMATCH
;
}
}
}
}
SERVER_END_REQ
;
SERVER_END_REQ
;
if
(
ret
!=
STATUS_SUCCESS
)
if
(
ret
!=
STATUS_SUCCESS
)
{
{
if
(
ret
==
STATUS_NO_MORE_FILES
)
ret
=
STATUS_SUCCESS
;
if
(
ret
==
STATUS_NO_MORE_FILES
)
ret
=
STATUS_SUCCESS
;
break
;
break
;
}
}
if
(
Length
>=
len
+
wlen
+
spi
->
dwThreadCount
*
sizeof
(
SYSTEM_THREAD_INFORMATION
))
else
/* Length is already checked for */
{
{
int
i
,
j
;
int
i
,
j
;
/* set thread info */
/* set thread info */
spi
->
dwOffset
+=
spi
->
dwThreadCount
*
sizeof
(
SYSTEM_THREAD_INFORMATION
);
len
+=
spi
->
dwThreadCount
*
sizeof
(
SYSTEM_THREAD_INFORMATION
);
i
=
j
=
0
;
i
=
j
=
0
;
while
(
ret
==
STATUS_SUCCESS
)
while
(
ret
==
STATUS_SUCCESS
)
{
{
...
@@ -768,13 +769,11 @@ NTSTATUS WINAPI NtQuerySystemInformation(
...
@@ -768,13 +769,11 @@ NTSTATUS WINAPI NtQuerySystemInformation(
spi
->
ProcessName
.
MaximumLength
=
wlen
;
spi
->
ProcessName
.
MaximumLength
=
wlen
;
memcpy
(
spi
->
ProcessName
.
Buffer
,
procname
,
spi
->
ProcessName
.
Length
);
memcpy
(
spi
->
ProcessName
.
Buffer
,
procname
,
spi
->
ProcessName
.
Length
);
spi
->
ProcessName
.
Buffer
[
spi
->
ProcessName
.
Length
/
sizeof
(
WCHAR
)]
=
0
;
spi
->
ProcessName
.
Buffer
[
spi
->
ProcessName
.
Length
/
sizeof
(
WCHAR
)]
=
0
;
len
+=
wlen
;
spi
->
dwOffset
+=
wlen
;
spi
->
dwOffset
+=
wlen
;
last
=
spi
;
last
=
spi
;
spi
=
(
SYSTEM_PROCESS_INFORMATION
*
)((
char
*
)
spi
+
spi
->
dwOffset
);
spi
=
(
SYSTEM_PROCESS_INFORMATION
*
)((
char
*
)
spi
+
spi
->
dwOffset
);
}
}
else
ret
=
STATUS_INFO_LENGTH_MISMATCH
;
}
}
if
(
ret
==
STATUS_SUCCESS
&&
last
)
last
->
dwOffset
=
0
;
if
(
ret
==
STATUS_SUCCESS
&&
last
)
last
->
dwOffset
=
0
;
if
(
hSnap
)
NtClose
(
hSnap
);
if
(
hSnap
)
NtClose
(
hSnap
);
...
...
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