You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2017/07/11 01:39:34 UTC

[48/50] mesos git commit: Windows: Made `process_entry()` use Unicode.

Windows: Made `process_entry()` use Unicode.

Review: https://reviews.apache.org/r/60343/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/fcbb67c7
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/fcbb67c7
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/fcbb67c7

Branch: refs/heads/master
Commit: fcbb67c77cbc2dd2e887c8f4a778c64f7c94fcd3
Parents: 76c58f4
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Mon Jul 10 15:46:17 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Mon Jul 10 17:15:39 2017 -0700

----------------------------------------------------------------------
 3rdparty/stout/include/stout/windows/os.hpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/fcbb67c7/3rdparty/stout/include/stout/windows/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/windows/os.hpp b/3rdparty/stout/include/stout/windows/os.hpp
index b234e15..f35bf31 100644
--- a/3rdparty/stout/include/stout/windows/os.hpp
+++ b/3rdparty/stout/include/stout/windows/os.hpp
@@ -474,7 +474,7 @@ inline tm* gmtime_r(const time_t* timep, tm* result)
 }
 
 
-inline Result<PROCESSENTRY32> process_entry(pid_t pid)
+inline Result<PROCESSENTRY32W> process_entry(pid_t pid)
 {
   // Get a snapshot of the processes in the system. NOTE: We should not check
   // whether the handle is `nullptr`, because this API will always return
@@ -488,9 +488,9 @@ inline Result<PROCESSENTRY32> process_entry(pid_t pid)
   SharedHandle safe_snapshot_handle(snapshot_handle, ::CloseHandle);
 
   // Initialize process entry.
-  PROCESSENTRY32 process_entry;
-  ZeroMemory(&process_entry, sizeof(PROCESSENTRY32));
-  process_entry.dwSize = sizeof(PROCESSENTRY32);
+  PROCESSENTRY32W process_entry;
+  memset(&process_entry, 0, sizeof(process_entry));
+  process_entry.dwSize = sizeof(process_entry);
 
   // Get first process so that we can loop through process entries until we
   // find the one we care about.
@@ -535,7 +535,7 @@ inline Result<PROCESSENTRY32> process_entry(pid_t pid)
 inline Result<Process> process(pid_t pid)
 {
   // Find process with pid.
-  Result<PROCESSENTRY32> entry = process_entry(pid);
+  Result<PROCESSENTRY32W> entry = process_entry(pid);
 
   if (entry.isError()) {
     return WindowsError(entry.error());
@@ -604,7 +604,7 @@ inline Result<Process> process(pid_t pid)
       Bytes(proc_mem_counters.WorkingSetSize),
       utime.isSome() ? utime.get() : Option<Duration>::none(),
       stime.isSome() ? stime.get() : Option<Duration>::none(),
-      entry.get().szExeFile,                   // Executable filename.
+      stringify(entry.get().szExeFile),        // Executable filename.
       false);                                  // Is not zombie process.
 }