I’m building an Microsoft RPC server and I was wondering if there is a way to determine which user called the RPC function? (meaning, which user is running the process that invoked the RPC method)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t know if there is a more efficient method, but one solution is to call RpcImpersonateClient, OpenThreadToken, and then RpcRevertToSelf or RpcRevertToSelfEx as appropriate.
You can get the user SID from the token with GetTokenInformation and convert it to a username if desired with LookupAccountSid.