How to convert RID to user-name?

If RID is “S-1-5-21-1614895754-854245398-1368107171-500”, RID means
“Administrator”.
And, If RID is “S-1-5-21-1614895754-854245398-1368107171-1002”, RID means
“OTHER USER”(eg, susan).

Then, How can i convert relative identifier(RID) to user-name?
Up to now, I converted binary SIDs to string SIDs, using
RtlConvertSidToUnicodeString function.

My target-mode is kernel-mode(not user-mode).
So, I use DDK.
In kernel-mode, It seems that “LookupAccountSid function” is not
available.

How can i convert RID to user-name in kernel-mode DDK.

Any information would be really useful.
With regard!

Chang Sung, Jung.