使用Ntsecapi.h,出现许多错误

nayajay 2008-12-01 03:31:33
#include "stdafx.h"
#include<Ntsecapi.h>
#include <Windows.h>
#pragma comment(lib,"Advapi32.lib")


int _tmain(int argc, _TCHAR* argv[])
{
LSA_OBJECT_ATTRIBUTES ObjectAttributes;
NTSTATUS ntsResult;
ZeroMemory(&ObjectAttributes,sizeof(ObjectAttributes));
LSA_HANDLE lsahPolicyHandle;

ntsResult=LsaOpenPolicy(NULL,&ObjectAttributes,POLICY_ALL_ACCESS,&lsahPolicyHandle);
if (ntsResult !=0) //STATUS_SUCCESS)//0
{
printf("failed");
return 1;
}
return 0;
}

错误如下:怎么办


c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(25) : error C2146: syntax error : missing ';' before identifier 'NTSTATUS'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(37) : error C2146: syntax error : missing ';' before identifier 'LSA_OPERATIONAL_MODE'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(37) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(37) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(37) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(448) : error C2146: syntax error : missing ';' before identifier 'Flags'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(448) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(448) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(450) : error C2146: syntax error : missing ';' before identifier 'Level'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(450) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(450) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(451) : error C2146: syntax error : missing ';' before identifier 'AccessMask'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(451) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(451) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(458) : error C2146: syntax error : missing ';' before identifier 'Data'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(458) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(458) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(459) : error C2146: syntax error : missing ';' before identifier 'Address'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\ntsecapi.h(459) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int


...全文
313 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
cnzdgs 2008-12-02
  • 打赏
  • 举报
回复
白看了。。
用户 昵称 2008-12-01
  • 打赏
  • 举报
回复
..
nayajay 2008-12-01
  • 打赏
  • 举报
回复
解决了
#include "stdafx.h"
#include <Windows.h>
#include <Ntsecapi.h>
#pragma comment(lib,"Advapi32.lib")
从SourceForge上Dump下来的MinGW最新版5.0.X完整版,涵盖完整迁移库,值得拥有。 完整可引入header列表: \MINGW\INCLUDE │ accctrl.h │ aclapi.h │ aclui.h │ adsprop.h │ afxres.h │ amaudio.h │ amvideo.h │ assert.h │ audevcod.h │ autosprintf.h │ aviriff.h │ aygshell.h │ basetsd.h │ basetyps.h │ bdatypes.h │ cderr.h │ cguid.h │ cmnquery.h │ comcat.h │ commctrl.h │ commdlg.h │ complex.h │ conio.h │ control.h │ cpl.h │ cplext.h │ ctype.h │ custcntl.h │ d3d9.h │ d3d9caps.h │ d3d9types.h │ dbt.h │ dde.h │ ddeml.h │ devguid.h │ dhcpcsdk.h │ dir.h │ direct.h │ dirent.h │ dlfcn.h │ dlgs.h │ docobj.h │ dos.h │ dsadmin.h │ dsclient.h │ dsgetdc.h │ dshow.h │ dsquery.h │ dsrole.h │ dvdevcod.h │ dvdmedia.h │ dxerr8.h │ dxerr9.h │ edevdefs.h │ errno.h │ errorrep.h │ errors.h │ evcode.h │ excpt.h │ exdisp.h │ exdispid.h │ fcntl.h │ fenv.h │ float.h │ fltdefs.h │ gdiplus.h │ getopt.h │ gettext-po.h │ glob.h │ gmon.h │ httpext.h │ icm.h │ iconv.h │ idispids.h │ il21dec.h │ imagehlp.h │ imm.h │ initguid.h │ intshcut.h │ inttypes.h │ io.h │ ipexport.h │ iphlpapi.h │ ipifcons.h │ ipinfoid.h │ iprtrmib.h │ iptypes.h │ ipxconst.h │ ipxrtdef.h │ ipxtfflt.h │ isguids.h │ ks.h │ ksmedia.h │ largeint.h │ libcharset.h │ libgen.h │ libintl.h │ limits.h │ lm.h │ lmaccess.h │ lmalert.h │ lmapibuf.h │ lmat.h │ lmaudit.h │ lmbrowsr.h │ lmchdev.h │ lmconfig.h │ lmcons.h │ lmerr.h │ lmerrlog.h │ lmmsg.h │ lmremutl.h │ lmrepl.h │ lmserver.h │ lmshare.h │ lmsname.h │ lmstats.h │ lmsvc.h │ lmuse.h │ lmuseflg.h │ lmwksta.h │ localcharset.h │ locale.h │ ltdl.h │ lzexpand.h │ malloc.h │ mapi.h │ math.h │ mbctype.h │ mbstring.h │ mciavi.h │ mcx.h │ mem.h │ memory.h │ mgm.h │ mgmtapi.h │ mlang.h │ mmreg.h │ mmsystem.h │ mpegtype.h │ mprapi.h │ mq.h │ msacm.h │ mshtml.h │ msvcrtver.h │ mswsock.h │ nb30.h │ nddeapi.h │ nspapi.h │ ntdef.h │ ntdll.h │ ntdsapi.h │ ntdsbcli.h │ ntldap.h │ ntsecapi.h │

16,548

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧