error code mapping

Hi Everyone,

At my work, I am working on logginigs and our program runs at NTDLL level.
So for the user, we do not want to log error code i.e. 0xC0000035 but more meaningful message such as ERROR_FILE_NOT_FOUND.

I know that this can be done in the user level but I was wondering if there is any existing function that does this translation at NTDLL.
After all, I could literally implement this mapping function but I do not want to reinvent the wheel if there is a such function.

Please give me some advice and thank you.

YEH

Well if you use WPP tracing (I know good and bad news here) you can do it
(of course that actually does the translation in user space). Otherwise,
no. You do realize that your table will take many megabytes of storage if
you want to do all of them? You should also realize the table will need to
be continually updated since Microsoft adds new codes all the time.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

wrote in message news:xxxxx@ntdev…
> Hi Everyone,
>
> At my work, I am working on logginigs and our program runs at NTDLL level.
> So for the user, we do not want to log error code i.e. 0xC0000035 but more
> meaningful message such as ERROR_FILE_NOT_FOUND.
>
> I know that this can be done in the user level but I was wondering if
> there is any existing function that does this translation at NTDLL.
> After all, I could literally implement this mapping function but I do not
> want to reinvent the wheel if there is a such function.
>
> Please give me some advice and thank you.
>
> YEH
>

I’m a little confused. Do you mean a native application? If so, there
are probably some options worth looking at at least, like
RtlFormatMessage. If you mean kernel mode, then, no, as Don pointed
out. However, I don’t think that it would take megabytes, if all you
wished were ‘ERROR_FILE_NOT_FOUND,’ et. c., and no descriptions, which
aren’t very useful anyway. Even if it were to take that much, you could
leave out those that there would be no reason to expect, like COM errors
perhaps, and should they appear, just default to displaying the error
code, and add them to your list next time.

Good luck,

mm

xxxxx@gmail.com wrote:

Hi Everyone,

At my work, I am working on logginigs and our program runs at NTDLL level.
So for the user, we do not want to log error code i.e. 0xC0000035 but more meaningful message such as ERROR_FILE_NOT_FOUND.

I know that this can be done in the user level but I was wondering if there is any existing function that does this translation at NTDLL.
After all, I could literally implement this mapping function but I do not want to reinvent the wheel if there is a such function.

Please give me some advice and thank you.

YEH

At NTDLL level, you have no Win32 and no Win32 error codes. Sorry.

0xc0000035 is NTSTATUS value, they are listed in ntstatus.h


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Hi Everyone,
>
> At my work, I am working on logginigs and our program runs at NTDLL level.
> So for the user, we do not want to log error code i.e. 0xC0000035 but more
meaningful message such as ERROR_FILE_NOT_FOUND.
>
> I know that this can be done in the user level but I was wondering if there
is any existing function that does this translation at NTDLL.
> After all, I could literally implement this mapping function but I do not
want to reinvent the wheel if there is a such function.
>
> Please give me some advice and thank you.
>
> YEH
>