Bug 1358552 - Fix incorrect ABI specification in js-ctypes declarations in toolkit. r=froydnj, a=gchang
authorAaron Klotz <aklotz@mozilla.com>
Tue, 25 Apr 2017 13:00:23 -0600
changeset 396065 f4279077d48fa17de2d76f3e9d0d896585dc6874
parent 396064 076868035c7498c29dcdefb9d28b6ed55d52fe83
child 396066 0ee6d3ac7a062d7546676f0e61c258aaf8c1f1c0
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj, gchang
bugs1358552
milestone54.0
Bug 1358552 - Fix incorrect ABI specification in js-ctypes declarations in toolkit. r=froydnj, a=gchang MozReview-Commit-ID: JuNNtbNC5pe
toolkit/modules/UpdateUtils.jsm
toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js
toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
toolkit/mozapps/update/tests/unit_aus_update/urlConstruction.js
--- a/toolkit/modules/UpdateUtils.jsm
+++ b/toolkit/modules/UpdateUtils.jsm
@@ -228,17 +228,17 @@ XPCOMUtils.defineLazyGetter(this, "gWinC
     kernel32 = ctypes.open("Kernel32");
   } catch (e) {
     Cu.reportError("Unable to open kernel32! Exception: " + e);
   }
 
   if (kernel32) {
     try {
       let GetNativeSystemInfo = kernel32.declare("GetNativeSystemInfo",
-                                                 ctypes.default_abi,
+                                                 ctypes.winapi_abi,
                                                  ctypes.void_t,
                                                  SYSTEM_INFO.ptr);
       let winSystemInfo = SYSTEM_INFO();
       // Default to unknown
       winSystemInfo.wProcessorArchitecture = 0xffff;
 
       GetNativeSystemInfo(winSystemInfo.address());
       switch (winSystemInfo.wProcessorArchitecture) {
@@ -330,17 +330,17 @@ XPCOMUtils.defineLazyGetter(UpdateUtils,
         osVersion += ".unknown (unknown)";
       }
 
       if (kernel32) {
         try {
           // Get Service pack info
           try {
             let GetVersionEx = kernel32.declare("GetVersionExW",
-                                                ctypes.default_abi,
+                                                ctypes.winapi_abi,
                                                 BOOL,
                                                 OSVERSIONINFOEXW.ptr);
             let winVer = OSVERSIONINFOEXW();
             winVer.dwOSVersionInfoSize = OSVERSIONINFOEXW.size;
 
             if (0 !== GetVersionEx(winVer.address())) {
               osVersion += "." + winVer.wServicePackMajor +
                            "." + winVer.wServicePackMinor;
--- a/toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js
+++ b/toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js
@@ -55,17 +55,17 @@ function getServicePack() {
       {wSuiteMask: WORD},
       {wProductType: BYTE},
       {wReserved: BYTE}
       ]);
 
   let kernel32 = ctypes.open("kernel32");
   try {
     let GetVersionEx = kernel32.declare("GetVersionExW",
-                                        ctypes.default_abi,
+                                        ctypes.winapi_abi,
                                         BOOL,
                                         OSVERSIONINFOEXW.ptr);
     let winVer = OSVERSIONINFOEXW();
     winVer.dwOSVersionInfoSize = OSVERSIONINFOEXW.size;
 
     if (0 === GetVersionEx(winVer.address())) {
       // Using "throw" instead of "do_throw" (see NOTE above)
       throw ("Failure in GetVersionEx (returned 0)");
@@ -100,17 +100,17 @@ function getProcArchitecture() {
       {dwAllocationGranularity: DWORD},
       {wProcessorLevel: WORD},
       {wProcessorRevision: WORD}
       ]);
 
   let kernel32 = ctypes.open("kernel32");
   try {
     let GetNativeSystemInfo = kernel32.declare("GetNativeSystemInfo",
-                                               ctypes.default_abi,
+                                               ctypes.winapi_abi,
                                                ctypes.void_t,
                                                SYSTEM_INFO.ptr);
     let sysInfo = SYSTEM_INFO();
     // Default to unknown
     sysInfo.wProcessorArchitecture = 0xffff;
 
     GetNativeSystemInfo(sysInfo.address());
     switch (sysInfo.wProcessorArchitecture) {
--- a/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
+++ b/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
@@ -2573,17 +2573,17 @@ function lockDirectory(aDirPath) {
   const LPVOID = ctypes.voidptr_t;
   const GENERIC_READ = 0x80000000;
   const FILE_SHARE_READ = 1;
   const FILE_SHARE_WRITE = 2;
   const OPEN_EXISTING = 3;
   const FILE_FLAG_BACKUP_SEMANTICS = 0x02000000;
   const INVALID_HANDLE_VALUE = LPVOID(0xffffffff);
   let kernel32 = ctypes.open("kernel32");
-  let CreateFile = kernel32.declare("CreateFileW", ctypes.default_abi,
+  let CreateFile = kernel32.declare("CreateFileW", ctypes.winapi_abi,
                                     LPVOID, LPCWSTR, DWORD, DWORD,
                                     LPVOID, DWORD, DWORD, LPVOID);
   gHandle = CreateFile(aDirPath, GENERIC_READ,
                        FILE_SHARE_READ | FILE_SHARE_WRITE, LPVOID(0),
                        OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, LPVOID(0));
   Assert.notEqual(gHandle.toString(), INVALID_HANDLE_VALUE.toString(),
                   "the handle should not equal INVALID_HANDLE_VALUE");
   kernel32.close();
@@ -3953,17 +3953,17 @@ function adjustGeneralPaths() {
       gProcess = null;
       debugDump("finish - kill process");
     }
 
     if (gHandle) {
       try {
         debugDump("start - closing handle");
         let kernel32 = ctypes.open("kernel32");
-        let CloseHandle = kernel32.declare("CloseHandle", ctypes.default_abi,
+        let CloseHandle = kernel32.declare("CloseHandle", ctypes.winapi_abi,
                                            ctypes.bool, /* return*/
                                            ctypes.voidptr_t /* handle*/);
         if (!CloseHandle(gHandle)) {
           debugDump("call to CloseHandle failed");
         }
         kernel32.close();
         gHandle = null;
         debugDump("finish - closing handle");
--- a/toolkit/mozapps/update/tests/unit_aus_update/urlConstruction.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/urlConstruction.js
@@ -191,17 +191,17 @@ function getServicePack() {
       {wSuiteMask: WORD},
       {wProductType: BYTE},
       {wReserved: BYTE}
     ]);
 
   let kernel32 = ctypes.open("kernel32");
   try {
     let GetVersionEx = kernel32.declare("GetVersionExW",
-                                        ctypes.default_abi,
+                                        ctypes.winapi_abi,
                                         BOOL,
                                         OSVERSIONINFOEXW.ptr);
     let winVer = OSVERSIONINFOEXW();
     winVer.dwOSVersionInfoSize = OSVERSIONINFOEXW.size;
 
     if (0 === GetVersionEx(winVer.address())) {
       // Using "throw" instead of "do_throw" (see NOTE above)
       throw ("Failure in GetVersionEx (returned 0)");
@@ -236,17 +236,17 @@ function getProcArchitecture() {
       {dwAllocationGranularity: DWORD},
       {wProcessorLevel: WORD},
       {wProcessorRevision: WORD}
     ]);
 
   let kernel32 = ctypes.open("kernel32");
   try {
     let GetNativeSystemInfo = kernel32.declare("GetNativeSystemInfo",
-                                               ctypes.default_abi,
+                                               ctypes.winapi_abi,
                                                ctypes.void_t,
                                                SYSTEM_INFO.ptr);
     let sysInfo = SYSTEM_INFO();
     // Default to unknown
     sysInfo.wProcessorArchitecture = 0xffff;
 
     GetNativeSystemInfo(sysInfo.address());
     switch (sysInfo.wProcessorArchitecture) {