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
4ed94f79
Commit
4ed94f79
authored
May 12, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
May 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Moved GetProcessMemoryInfo implementation to kernel32.
parent
ed6c309f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
42 deletions
+44
-42
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-0
process.c
dlls/kernel32/process.c
+42
-0
psapi.spec
dlls/psapi/psapi.spec
+1
-1
psapi_main.c
dlls/psapi/psapi_main.c
+0
-41
No files found.
dlls/kernel32/kernel32.spec
View file @
4ed94f79
...
@@ -772,6 +772,7 @@
...
@@ -772,6 +772,7 @@
@ stdcall K32GetProcessImageFileNameW(long ptr long)
@ stdcall K32GetProcessImageFileNameW(long ptr long)
@ stdcall K32EnumProcessModules(long ptr long ptr)
@ stdcall K32EnumProcessModules(long ptr long ptr)
@ stdcall K32EnumProcesses(ptr long ptr)
@ stdcall K32EnumProcesses(ptr long ptr)
@ stdcall K32GetProcessMemoryInfo(long ptr long)
@ stdcall K32QueryWorkingSet(long ptr long)
@ stdcall K32QueryWorkingSet(long ptr long)
@ stdcall K32QueryWorkingSetEx(long ptr long)
@ stdcall K32QueryWorkingSetEx(long ptr long)
@ stdcall -i386 -private -register K32Thk1632Epilog() krnl386.exe16.K32Thk1632Epilog
@ stdcall -i386 -private -register K32Thk1632Epilog() krnl386.exe16.K32Thk1632Epilog
...
...
dlls/kernel32/process.c
View file @
4ed94f79
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
#define WIN32_NO_STATUS
#define WIN32_NO_STATUS
#include "winternl.h"
#include "winternl.h"
#include "kernel_private.h"
#include "kernel_private.h"
#include "psapi.h"
#include "wine/library.h"
#include "wine/library.h"
#include "wine/server.h"
#include "wine/server.h"
#include "wine/unicode.h"
#include "wine/unicode.h"
...
@@ -3622,6 +3623,47 @@ BOOL WINAPI K32QueryWorkingSetEx( HANDLE process, LPVOID buffer, DWORD size )
...
@@ -3622,6 +3623,47 @@ BOOL WINAPI K32QueryWorkingSetEx( HANDLE process, LPVOID buffer, DWORD size )
}
}
/***********************************************************************
/***********************************************************************
* K32GetProcessMemoryInfo (KERNEL32.@)
*
* Retrieve memory usage information for a given process
*
*/
BOOL
WINAPI
K32GetProcessMemoryInfo
(
HANDLE
process
,
PPROCESS_MEMORY_COUNTERS
pmc
,
DWORD
cb
)
{
NTSTATUS
status
;
VM_COUNTERS
vmc
;
if
(
cb
<
sizeof
(
PROCESS_MEMORY_COUNTERS
))
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
}
status
=
NtQueryInformationProcess
(
process
,
ProcessVmCounters
,
&
vmc
,
sizeof
(
vmc
),
NULL
);
if
(
status
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
));
return
FALSE
;
}
pmc
->
cb
=
sizeof
(
PROCESS_MEMORY_COUNTERS
);
pmc
->
PageFaultCount
=
vmc
.
PageFaultCount
;
pmc
->
PeakWorkingSetSize
=
vmc
.
PeakWorkingSetSize
;
pmc
->
WorkingSetSize
=
vmc
.
WorkingSetSize
;
pmc
->
QuotaPeakPagedPoolUsage
=
vmc
.
QuotaPeakPagedPoolUsage
;
pmc
->
QuotaPagedPoolUsage
=
vmc
.
QuotaPagedPoolUsage
;
pmc
->
QuotaPeakNonPagedPoolUsage
=
vmc
.
QuotaPeakNonPagedPoolUsage
;
pmc
->
QuotaNonPagedPoolUsage
=
vmc
.
QuotaNonPagedPoolUsage
;
pmc
->
PagefileUsage
=
vmc
.
PagefileUsage
;
pmc
->
PeakPagefileUsage
=
vmc
.
PeakPagefileUsage
;
return
TRUE
;
}
/***********************************************************************
* ProcessIdToSessionId (KERNEL32.@)
* ProcessIdToSessionId (KERNEL32.@)
* This function is available on Terminal Server 4SP4 and Windows 2000
* This function is available on Terminal Server 4SP4 and Windows 2000
*/
*/
...
...
dlls/psapi/psapi.spec
View file @
4ed94f79
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
@ stdcall GetPerformanceInfo(ptr long)
@ stdcall GetPerformanceInfo(ptr long)
@ stdcall GetProcessImageFileNameA(long ptr long) kernel32.K32GetProcessImageFileNameA
@ stdcall GetProcessImageFileNameA(long ptr long) kernel32.K32GetProcessImageFileNameA
@ stdcall GetProcessImageFileNameW(long ptr long) kernel32.K32GetProcessImageFileNameW
@ stdcall GetProcessImageFileNameW(long ptr long) kernel32.K32GetProcessImageFileNameW
@ stdcall GetProcessMemoryInfo(long ptr long)
@ stdcall GetProcessMemoryInfo(long ptr long)
kernel32.K32GetProcessMemoryInfo
@ stdcall GetWsChanges(long ptr long)
@ stdcall GetWsChanges(long ptr long)
@ stdcall InitializeProcessForWsWatch(long)
@ stdcall InitializeProcessForWsWatch(long)
@ stdcall QueryWorkingSet(long ptr long) kernel32.K32QueryWorkingSet
@ stdcall QueryWorkingSet(long ptr long) kernel32.K32QueryWorkingSet
...
...
dlls/psapi/psapi_main.c
View file @
4ed94f79
...
@@ -407,47 +407,6 @@ BOOL WINAPI GetPerformanceInfo( PPERFORMANCE_INFORMATION info, DWORD size )
...
@@ -407,47 +407,6 @@ BOOL WINAPI GetPerformanceInfo( PPERFORMANCE_INFORMATION info, DWORD size )
}
}
/***********************************************************************
/***********************************************************************
* GetProcessMemoryInfo (PSAPI.@)
*
* Retrieve memory usage information for a given process
*
*/
BOOL
WINAPI
GetProcessMemoryInfo
(
HANDLE
hProcess
,
PPROCESS_MEMORY_COUNTERS
pmc
,
DWORD
cb
)
{
NTSTATUS
status
;
VM_COUNTERS
vmc
;
if
(
cb
<
sizeof
(
PROCESS_MEMORY_COUNTERS
))
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
}
status
=
NtQueryInformationProcess
(
hProcess
,
ProcessVmCounters
,
&
vmc
,
sizeof
(
vmc
),
NULL
);
if
(
status
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
));
return
FALSE
;
}
pmc
->
cb
=
sizeof
(
PROCESS_MEMORY_COUNTERS
);
pmc
->
PageFaultCount
=
vmc
.
PageFaultCount
;
pmc
->
PeakWorkingSetSize
=
vmc
.
PeakWorkingSetSize
;
pmc
->
WorkingSetSize
=
vmc
.
WorkingSetSize
;
pmc
->
QuotaPeakPagedPoolUsage
=
vmc
.
QuotaPeakPagedPoolUsage
;
pmc
->
QuotaPagedPoolUsage
=
vmc
.
QuotaPagedPoolUsage
;
pmc
->
QuotaPeakNonPagedPoolUsage
=
vmc
.
QuotaPeakNonPagedPoolUsage
;
pmc
->
QuotaNonPagedPoolUsage
=
vmc
.
QuotaNonPagedPoolUsage
;
pmc
->
PagefileUsage
=
vmc
.
PagefileUsage
;
pmc
->
PeakPagefileUsage
=
vmc
.
PeakPagefileUsage
;
return
TRUE
;
}
/***********************************************************************
* GetWsChanges (PSAPI.@)
* GetWsChanges (PSAPI.@)
*/
*/
BOOL
WINAPI
GetWsChanges
(
HANDLE
process
,
PPSAPI_WS_WATCH_INFORMATION
watchinfo
,
DWORD
size
)
BOOL
WINAPI
GetWsChanges
(
HANDLE
process
,
PPSAPI_WS_WATCH_INFORMATION
watchinfo
,
DWORD
size
)
...
...
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