| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include <process.h> | 5 #include <process.h> |
| 6 | 6 |
| 7 #include "bin/builtin.h" | 7 #include "bin/builtin.h" |
| 8 #include "bin/process.h" | 8 #include "bin/process.h" |
| 9 #include "bin/eventhandler.h" | 9 #include "bin/eventhandler.h" |
| 10 #include "bin/log.h" | 10 #include "bin/log.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 | 331 |
| 332 | 332 |
| 333 static InitProcThreadAttrListFn init_proc_thread_attr_list = NULL; | 333 static InitProcThreadAttrListFn init_proc_thread_attr_list = NULL; |
| 334 static UpdateProcThreadAttrFn update_proc_thread_attr = NULL; | 334 static UpdateProcThreadAttrFn update_proc_thread_attr = NULL; |
| 335 static DeleteProcThreadAttrListFn delete_proc_thread_attr_list = NULL; | 335 static DeleteProcThreadAttrListFn delete_proc_thread_attr_list = NULL; |
| 336 | 336 |
| 337 | 337 |
| 338 static bool EnsureInitialized() { | 338 static bool EnsureInitialized() { |
| 339 static bool load_attempted = false; | 339 static bool load_attempted = false; |
| 340 static dart::Mutex mutex; | 340 static dart::Mutex mutex; |
| 341 HMODULE kernel32_module = GetModuleHandle(L"kernel32.dll"); | 341 HMODULE kernel32_module = GetModuleHandleW(L"kernel32.dll"); |
| 342 if (!load_attempted) { | 342 if (!load_attempted) { |
| 343 MutexLocker locker(&mutex); | 343 MutexLocker locker(&mutex); |
| 344 if (load_attempted) return delete_proc_thread_attr_list != NULL; | 344 if (load_attempted) return delete_proc_thread_attr_list != NULL; |
| 345 init_proc_thread_attr_list = reinterpret_cast<InitProcThreadAttrListFn>( | 345 init_proc_thread_attr_list = reinterpret_cast<InitProcThreadAttrListFn>( |
| 346 GetProcAddress(kernel32_module, "InitializeProcThreadAttributeList")); | 346 GetProcAddress(kernel32_module, "InitializeProcThreadAttributeList")); |
| 347 update_proc_thread_attr = | 347 update_proc_thread_attr = |
| 348 reinterpret_cast<UpdateProcThreadAttrFn>( | 348 reinterpret_cast<UpdateProcThreadAttrFn>( |
| 349 GetProcAddress(kernel32_module, "UpdateProcThreadAttribute")); | 349 GetProcAddress(kernel32_module, "UpdateProcThreadAttribute")); |
| 350 delete_proc_thread_attr_list = reinterpret_cast<DeleteProcThreadAttrListFn>( | 350 delete_proc_thread_attr_list = reinterpret_cast<DeleteProcThreadAttrListFn>( |
| 351 reinterpret_cast<DeleteProcThreadAttrListFn>( | 351 reinterpret_cast<DeleteProcThreadAttrListFn>( |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 | 652 |
| 653 | 653 |
| 654 void Process::TerminateExitCodeHandler() { | 654 void Process::TerminateExitCodeHandler() { |
| 655 // Nothing needs to be done on Windows. | 655 // Nothing needs to be done on Windows. |
| 656 } | 656 } |
| 657 | 657 |
| 658 | 658 |
| 659 intptr_t Process::CurrentProcessId() { | 659 intptr_t Process::CurrentProcessId() { |
| 660 return static_cast<intptr_t>(GetCurrentProcessId()); | 660 return static_cast<intptr_t>(GetCurrentProcessId()); |
| 661 } | 661 } |
| OLD | NEW |