07-02-2025, 21:49
(06-12-2022, 11:07)jimbab Wrote: EDIT: for people getting 'Fatal Error -13' , read bottom of post.
I've just attempted to use this tool and had some issues. First of all, for everyone's sake. Here's an explanation for each error code you can receive:
Fatal Error -16 = Unknown (GetFileAttributes returnsINVALID_FILE_ATTRIBUTES)
Fatal Error -15 = Generally, this means that the file either doesn't exist or there is something else wrong with accessing it.
Fatal Error -14 = The file is less than 128 bytes in size (0.125 of a kilobyte)
Fatal Error -13 = The file is too large (bigger than 64 megabytes) (Read below please)
Fatal Error -12 = Unknown (CreateFileMappingA fails/returns null)
Fatal Error -11 = Unknown (MapViewOfFile fails/returns null)
NOTE about 'Fatal Error -13':
I got this error a few times when inputting files that weren't actually bigger than 64 megabyte, nor even close to that size. It turns out there was probably an issue in the way file was saved with permissions.
Solution 1: Set iwi_dds_fast_converter.exe to Run as Administrator inside it's compatibility settings, it should work fine then.
Solution 2: Go into the properties of the file you are trying to convert, go to the security tab, click 'Edit', select the Users group in the top pane, then tick the 'Full Control' tickbox in the bottom pane. Press Ok, and Ok, and this should fix the error.
For the developer:In the code, I noticed that there was a mistake in the error checking. CreateFileA and GetFileSize both return non-null values when they fail. However, you are checking if the return result == null... instead, check if CreateFileA returns -1 instead, as this is what happens when it fails. Otherwise the execution continues and GetFileSize obviously fails, and ALSO returns -1 which gets cast to an unsigned value which means it will be read as 0xFFFFFFFF, or4,294,967,295, which is obviously much bigger than the 67108736 byte (64mB) limit that is in the code, after the call to GetFileSize.
Can you share the sourcecode or if you updated it the executable pleaseeeee