Develop
Ticket #441 (closed defect: fixed)
MoFile loader fails
| Reported by: | hjr | Owned by: | max |
|---|---|---|---|
| Priority: | normal | Milestone: | XCSoar 6.0.x |
| Component: | Translations | Version: | 6.0a |
| Keywords: | mofile | Cc: |
Description
The language file de.mo does not load on the WM5 build for HP ipaq 300, it works fine for the PC build.
Tracked it down to the point where the file gets mapped:
FileMapping?.cpp (110):
hMapping = ::CreateFileMapping?(... return an invalid handle, whereas the check on invalid handle does not work either.
Change History
comment:3 Changed 3 years ago by hjr
CreateFileMapping?() returns 0. The call seems to be ok. The filehandle is ok the file size is perfect.
Last errno is set to 6, which means invalid handle.
To check the result there is:
if (gcc_unlikely(hMapping == INVALID_HANDLE_VALUE))
which does not evaluate to true, whereas:
if (hMapping == NULL)
evaluates to true.
comment:4 Changed 3 years ago by max
Right, CreateFileMapping?() is documented to return NULL on failure, while all other HANDLE functions return INVALID_HANDLE_VALUE.
comment:5 Changed 3 years ago by max
Error handling fixed in fb92f42d9d264eff5419bceeead4f172318cf5a2

so what does CreateFileMapping?() return? Why does the check not work?