Bug 771617 - Fix WinFile.{ReadFile, WriteFile} to accept void*. r=froydnj
authorDavid Rajchenbach-Teller <dteller@mozilla.com>
Sat, 25 Aug 2012 17:18:43 -0400
changeset 105488 7b6763a02065f5901e5f6db6a419d714b0282567
parent 105487 e555d4f92c1dd06e24abf8734141dfc02634b636
child 105489 8a9316111cf6ac23874f412b67f090848e21ab08
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersfroydnj
bugs771617
milestone17.0a1
Bug 771617 - Fix WinFile.{ReadFile, WriteFile} to accept void*. r=froydnj
toolkit/components/osfile/osfile_win_back.jsm
--- a/toolkit/components/osfile/osfile_win_back.jsm
+++ b/toolkit/components/osfile/osfile_win_back.jsm
@@ -276,17 +276,17 @@
                     /*destPath*/ Types.path,
                     /*flags*/    Types.DWORD
                    );
 
        WinFile.ReadFile =
          declareFFI("ReadFile", ctypes.winapi_abi,
                     /*return*/ Types.zero_or_nothing,
                     /*file*/   Types.HANDLE,
-                    /*buffer*/ Types.char.out_ptr,
+                    /*buffer*/ Types.voidptr_t,
                     /*nbytes*/ Types.DWORD,
                     /*nbytes_read*/Types.DWORD.out_ptr,
                     /*overlapped*/Types.void_t.inout_ptr // FIXME: Implement?
          );
 
        WinFile.RemoveDirectory =
          declareFFI("RemoveDirectoryW", ctypes.winapi_abi,
                     /*return*/ Types.zero_or_nothing,
@@ -310,17 +310,17 @@
                     /*distlow*/Types.long,
                     /*disthi*/ Types.long.in_ptr,
                     /*method*/ Types.DWORD);
 
        WinFile.WriteFile =
          declareFFI("WriteFile", ctypes.winapi_abi,
                     /*return*/ Types.zero_or_nothing,
                     /*file*/   Types.HANDLE,
-                    /*buffer*/ Types.char.in_ptr,
+                    /*buffer*/ Types.voidptr_t,
                     /*nbytes*/ Types.DWORD,
                     /*nbytes_wr*/Types.DWORD.out_ptr,
                     /*overlapped*/Types.void_t.inout_ptr // FIXME: Implement?
          );
      };
      exports.OS.Win.File._init = init;
    })(this);
 }