aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2016-06-27 18:00:01 +0200
committerCorinna Vinschen <corinna@vinschen.de>2016-06-27 18:00:01 +0200
commit532ecdd36f37e4c5985b8a7c992324e5df48f7a1 (patch)
tree558a69816cfde214e0e4ddde9a44b005ca2d2c12 /winsup
parentba58e5f20ce9326ceb30baa461b53546acec9333 (diff)
downloadnewlib-532ecdd36f37e4c5985b8a7c992324e5df48f7a1.zip
newlib-532ecdd36f37e4c5985b8a7c992324e5df48f7a1.tar.gz
newlib-532ecdd36f37e4c5985b8a7c992324e5df48f7a1.tar.bz2
Add comment to point out missing access right per documentation
In get_mem_values we open the process without PROCESS_VM_READ access and are *still* able to request working set information, despite MSDN claiming we need it for this purpose. Instead of adding this access right, just add an comment to point this out for now. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/fhandler_process.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc
index 9730fa7..216f095 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -1436,6 +1436,10 @@ get_mem_values (DWORD dwProcessId, unsigned long *vmsize, unsigned long *vmrss,
PMEMORY_WORKING_SET_LIST p;
SIZE_T n = 0x4000, length;
+ /* This appears to work despite MSDN claiming that QueryWorkingSSet requires
+ PROCESS_QUERY_INFORMATION *and* PROCESS_VM_READ. Since we're trying to do
+ everything with least perms, we stick to PROCESS_QUERY_INFORMATION only
+ unless this changes in Windows for some reason. */
hProcess = OpenProcess (PROCESS_QUERY_INFORMATION, FALSE, dwProcessId);
if (hProcess == NULL)
{