Home > Software engineering >  Using the administrator account under Win10 CreateProcessWithLogonW insufficient permissions
Using the administrator account under Win10 CreateProcessWithLogonW insufficient permissions

Time:05-25

In Win10 administrator account and password, in start a program that requires high authority also suggests insufficient permissions;
If start the software without permission demands, is operating normally,
Code is using Microsoft's example, roughly as follows:
 
if (! LogonUser (argv [1], NULL, argv [2], LOGON32_LOGON_INTERACTIVE,
LOGON32_PROVIDER_DEFAULT, & amp; HToken))
DisplayError (L "LogonUser");

if (! CreateEnvironmentBlock (& amp; LpvEnv hToken, TRUE))
DisplayError (L "CreateEnvironmentBlock");

DwSize=sizeof (szUserProfile)/sizeof (WCHAR);

if (! GetUserProfileDirectory (hToken szUserProfile, & amp; DwSize))
DisplayError (L "GetUserProfileDirectory");

//
//TO DO: change NULL TO '. 'TO use the local account database
//
if (! CreateProcessWithLogonW (argv [1], NULL, argv [2],
LOGON_WITH_PROFILE, NULL, argv [3],
CREATE_UNICODE_ENVIRONMENT, lpvEnv szUserProfile,
& Si, & amp; PI))
DisplayError (L "CreateProcessWithLogonW");

if (! DestroyEnvironmentBlock (lpvEnv))
DisplayError (L "DestroyEnvironmentBlock");



CodePudding user response:

Hope everybody to help me!!!!!!!!!!!!!!!!

CodePudding user response:

Using CreateProcessAsUserW and CreateProcessWithTokenW is also insufficient permissions
What should I do

CodePudding user response:

Is the use of ordinary users can also open the administrator program function,,,
  • Related