Hi,
while debugging an application (Project One, available at [1]), I noticed that wine (today's git) throws a lot of these fixmes:
fixme:ntdll:RtlNtStatusToDosErrorNoTeb no mapping for c0000109
Looking around, I found this page[2] stating that ERROR_MR_MID_NOT_FOUND is an expected return value for c0000109, so that the fixme is not needed here. I updated the if clause accordingly:
diff --git a/dlls/ntdll/error.c b/dlls/ntdll/error.c index 9469f6f..e125163 100644 --- a/dlls/ntdll/error.c +++ b/dlls/ntdll/error.c @@ -68,7 +68,9 @@ ULONG WINAPI RtlNtStatusToDosErrorNoTeb( NTSTATUS status ) if (status < table->end) { DWORD ret = table->table[status - table->start]; - if (ret == ERROR_MR_MID_NOT_FOUND) FIXME( "no mapping for %08x\n", status ); + if (ret == ERROR_MR_MID_NOT_FOUND && + status != STATUS_MESSAGE_NOT_FOUND) + FIXME( "no mapping for %08x\n", status ); return ret; } table++;
This solution has the advantage of being not very intrusive, but the disadvantage that it might be not nicely maintainable. Another &&-block has to be added for each other status found validly returning ERROR_MR_MID_NOT_FOUND.
Another solution might be to define, let's say, ERROR_WINE_FIXME for all real fixmes and convert them to ERROR_MR_MID_NOT_FOUND. Something like (just a draft):
#define ERROR_WINE_FIXME 0xffffffff
DWORD ret = table->table[status - table->start]; if (ret == ERROR_WINE_FIXME) { FIXME( "no mapping for %08x\n", status ); ret = ERROR_MR_MID_NOT_FOUND; } return ret;
[and lots of table entries changed]
Well, this is pretty intrusive, but may be better distinguishing the different cases perhaps. Then again, this additional #define is polluting the ERROR_-namespace.
I think I prefer the first version for now, perhaps there is no second status validly returning ERROR_MR_MID_NOT_FOUND? Any advice on how I should proceed?
Thanks in advance,
Wolfram
[1] ftp://ftp.scs-trc.net/pub/c64/Tools/Graphics/Project1_V0.5.zip [2] http://support.microsoft.com/kb/113996
"Wolfram Sang" wolfram@the-dreams.de wrote:
Another solution might be to define, let's say, ERROR_WINE_FIXME for all real fixmes and convert them to ERROR_MR_MID_NOT_FOUND.
If a FIXME is not appropriate it should be replaced by a WARN. Although most of the places it's used are the places with missing functionality.
A real solution for the problem above is to write a test case and add a mapping for missing status code(s).
Hello Dmitry,
thanks for your fast reply. Sorry, I might be still missing something, as I am a bit confused with some details.
Dmitry Timoshkov wrote:
Another solution might be to define, let's say, ERROR_WINE_FIXME for all real fixmes and convert them to ERROR_MR_MID_NOT_FOUND.
If a FIXME is not appropriate it should be replaced by a WARN. Although most of the places it's used are the places with missing functionality.
Well, that's what the fixme does in more than 99% of the cases. The proper return value is unknown and ERROR_MR_MID_NOT_FOUND is returned as a best fit. Those cases should be fixed somewhen.
There is just one exception (so far), which does not need the fixme because ERROR_MR_MID_NOT_FOUND is the intended answer. This is the one I want to silence, no need for a WARN here?
A real solution for the problem above is to write a test case
I'd think there is one already?
wsa@katana:~/Tools/wine$ grep 'STATUS_MESSAGE_NOT_FOUND' dlls/ntdll/tests/error.c cmp(STATUS_MESSAGE_NOT_FOUND, ERROR_MR_MID_NOT_FOUND);
and add a mapping for missing status code(s).
Which would be my second proposal?
Regards,
Wolfram