Impersonation and CurrentUser Registry Access

前端 未结 2 1836
孤城傲影
孤城傲影 2020-12-16 16:23

Environment: Windows XP SP3, C#, .Net 4.0

Problem:

I\'m attempting to add access to an impersonated users registry hive in an impersonation class and I\'m ru

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-16 17:16

    I found that the logon type set in the call to LogonUser() can be a factor. Even when running as an administrator I couldn't get past the error unless I switched from LOGON32_LOGON_INTERACTIVE to LOGON32_LOGON_BATCH. You would need to be sure the "Log on as a batch job" group policy doesn't interfere though.

提交回复
热议问题