Procedure entry point error when using CreateProcessWithTokenW
-
First off, I'm real new to C++ so hopefully I state things right and I'm in the correct forum. I'm tinkering with some code to use the CreateProcessWithTokenW function (http://msdn.microsoft.com/en-us/library/windows/desktop/ms682434(v=vs.85).aspx). Now, everything works just fine when I run it on Windows 7. But if I run it on XP, it bombs out with an error message about the procedure entry point not being located in the dynamic link library ADVAPI32.dll. So what do I need to do to either make this work on XP, or else drop back to using CreateProcessAsUser on Windows XP, but still use CreateProcessWithTokenW on Windows 7?
-
First off, I'm real new to C++ so hopefully I state things right and I'm in the correct forum. I'm tinkering with some code to use the CreateProcessWithTokenW function (http://msdn.microsoft.com/en-us/library/windows/desktop/ms682434(v=vs.85).aspx). Now, everything works just fine when I run it on Windows 7. But if I run it on XP, it bombs out with an error message about the procedure entry point not being located in the dynamic link library ADVAPI32.dll. So what do I need to do to either make this work on XP, or else drop back to using CreateProcessAsUser on Windows XP, but still use CreateProcessWithTokenW on Windows 7?
According to this page[^], it is not supported on XP. The minimum supported client is Windows Vista. :)
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
-
First off, I'm real new to C++ so hopefully I state things right and I'm in the correct forum. I'm tinkering with some code to use the CreateProcessWithTokenW function (http://msdn.microsoft.com/en-us/library/windows/desktop/ms682434(v=vs.85).aspx). Now, everything works just fine when I run it on Windows 7. But if I run it on XP, it bombs out with an error message about the procedure entry point not being located in the dynamic link library ADVAPI32.dll. So what do I need to do to either make this work on XP, or else drop back to using CreateProcessAsUser on Windows XP, but still use CreateProcessWithTokenW on Windows 7?
Hi, I am very happy to hear that you went straight to MSDN to get your answers. That is definitely a working recipe for becoming a better software engineer. When you are reading these MSDN function descriptions... always scroll to the bottom... the MSDN almost always gives which library the function is being exported from (in this case Advapi32.dll) and the minimum operating system/service pack required. You have obviously already discovered that the minimum OS is Vista for this function. If you already have an access token then you should use the CreateProcessAsUser function[^]
Lucidation wrote:
So what do I need to do to either make this work on XP, or else drop back to using CreateProcessAsUser on Windows XP, but still use CreateProcessWithTokenW on Windows 7?
I would personally recommend using CreateProcessAsUser for both scenarios. Why create two code paths? CreateProcessAsUser should work for XP all the way to Win7Sp1. Best Wishes, -David Delaune