AdjustTokenPrivileges失败,错误为1300 [英] AdjustTokenPrivileges Failed with Error 1300

查看:950
本文介绍了AdjustTokenPrivileges失败,错误为1300的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经开发了SNMP扩展DLL来远程执行诸如关机,重新启动等操作.它在XP上运行良好.现在我正在为Windows 7迁移DLL.我从MSDN上阅读了会话-0隔离的影响"文档并按照DLL迁移的说明进行操作.例如,我遵循了 错误:1300并非所有引用的特权或组都分配给了调用方.

有什么方法可以解决此错误吗????

Hi,

I have developed SNMP extension DLL to perform some operations like Shutdown,Restart,etc Remotely.It is working fine with XP.Now I am migrating the DLL for Windows 7.I have read the document "impact of session-0 isolation" from MSDN and followed the instructions for DLL migration.For example, I have followed the instructions in the link http://msdn.microsoft.com/en-us/library/windows/desktop/aa376871(v=vs.85).aspx and coded the same for the shutdown operation. But "AdjustTokenPrivileges" always returning Error:1300 Not all privileges or groups referenced are assigned to the caller.

Is there any way to solve this error??????

推荐答案

来自MSDN [
From the MSDN[^]:
报价:

AdjustTokenPrivileges函数无法向访问令牌添加新特权.它只能启用或禁用令牌的现有特权.要确定令牌的特权,请调用GetTokenInformation函数.

The AdjustTokenPrivileges function cannot add new privileges to the access token. It can only enable or disable the token''s existing privileges. To determine the token''s privileges, call the GetTokenInformation function.

第一步,您可以按照MSDN的建议检查特权.

该代码必须以足够的特权执行.通常允许用户关闭并重新启动.但是您正在尝试使用SNMP远程执行此操作. MS SNMP代理是可能不允许关闭系统的服务(我不确定,但是在没有任何用户交互的情况下不允许关闭服务是有道理的.)

As first step you may check the privileges as suggested by the MSDN.

The code must be executed with sufficient privileges. Users are usually allowed to shutdown and restart. But you are trying to do this remotely using SNMP. The MS SNMP agent is a service which is probably not allowed to shutdown the system (I don''t know for sure, but it makes sense that a service is not allowed to shutdown without any user interaction).


这篇关于AdjustTokenPrivileges失败,错误为1300的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆