If you are writing a Windows service, using LOGON32_LOGON_SERVICE instead of LOGON32_LOGON_INTERACTIVE or LOGON32_LOGON_NEW_CREDENTIALS will result in a privileged token if the user you want to impersonate has the "log in as a service" access rights.
This does not provide a general solution (it will not work if you are writing a user-oriented application), but this is enough to solve a specific problem.
source share