1# HG changeset patch
2# User Tom Ritter <tom@mozilla.com>
3# Date 1516720544 21600
4#      Tue Jan 23 09:15:44 2018 -0600
5# Node ID 2b4556cb7407c196522e52cfd286ee88c3bb6e72
6# Parent  60aa47b111918d4e30f7e363359d1dcc3a3f277d
7Bug 1432295 Cast GetProcAddress to (void*) r?bobowen
8
9error: invalid conversion from 'FARPROC {aka int (__attribute__((__stdcall__)) *)()}' to 'void*' [-fpermissive]
10
11According to http://stackoverflow.com/questions/13958081/, msvc does the fixup
12
13diff --git a/security/sandbox/chromium/sandbox/win/src/target_process.cc b/security/sandbox/chromium/sandbox/win/src/target_process.cc
14--- a/security/sandbox/chromium/sandbox/win/src/target_process.cc
15+++ b/security/sandbox/chromium/sandbox/win/src/target_process.cc
16@@ -231,17 +231,17 @@ ResultCode TargetProcess::TransferVariab
17
18   void* child_var = address;
19
20 #if SANDBOX_EXPORTS
21   HMODULE module = ::LoadLibrary(exe_name_.get());
22   if (!module)
23     return SBOX_ERROR_CANNOT_LOADLIBRARY_EXECUTABLE;
24
25-  child_var = ::GetProcAddress(module, name);
26+  child_var = reinterpret_cast<void*>(::GetProcAddress(module, name));
27   ::FreeLibrary(module);
28
29   if (!child_var)
30     return SBOX_ERROR_CANNOT_FIND_VARIABLE_ADDRESS;
31
32   size_t offset =
33       reinterpret_cast<char*>(child_var) - reinterpret_cast<char*>(module);
34   child_var = reinterpret_cast<char*>(MainModule()) + offset;
35