EnumProcessModulesEx missing in psapi.h

元气小坏坏 提交于 2019-12-11 08:26:52

问题


I am trying to enumerate all the processes running in windows, both 32bit and 64bit, for 64bit I need to call EnumProcessModulesEx, which isn't available in the psapi.h with Devc++ that I am using, so I downloaded Windows8 SDK.

So now I have the psapi.h with EnumProcessModulesEx defined but its giving me all kind of errors when I include it in my project. I included the path to the directories consisting of all the header files which came with the SDK, What am I supposed to do ?

Here is the error list :

    main.cpp:35: error: `K32EnumProcessModulesEx' cannot be used as a function
    main.cpp:63: error: `K32EnumProcessModulesEx' cannot be used as a function
    main.cpp:65: error: `K32GetModuleBaseNameA' cannot be used as a function

    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:89: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:90: error: `cb' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:90: error: `_Out_writes_bytes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:91: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:92: error: `_Out_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:93: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:97: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:98: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:99: error: `cb' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:99: error: `_Out_writes_bytes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:100: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:101: error: `_Out_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:102: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:106: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:107: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:108: error: `cb' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:108: error: `_Out_writes_bytes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:109: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:110: error: `_Out_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:111: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:112: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:116: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:117: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:118: error: `_In_opt_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:119: error: `nSize' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:119: error: `_Out_writes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:120: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:121: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:125: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:126: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:127: error: `_In_opt_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:128: error: `nSize' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:128: error: `_Out_writes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:129: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:130: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:139: error: expected constructor, destructor, or type conversion before '(' token
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:139: error: expected `,' or `;' before '(' token
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:152: error: expected constructor, destructor, or type conversion before '(' token
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:152: error: expected `,' or `;' before '(' token
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:181: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:182: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:183: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:184: error: `_Out_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:185: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:186: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:191: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:192: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:271: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:272: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:273: error: `cb' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:273: error: `_Out_writes_bytes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:274: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:275: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:279: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:280: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:281: error: `cb' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:281: error: `_Out_writes_bytes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:282: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:283: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:287: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:288: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:304: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:305: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:306: error: `cb' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:306: error: `_Out_writes_bytes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:307: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:308: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:312: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:313: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:314: error: `cb' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:314: error: `cb' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:314: error: `_Out_writes_bytes_to_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:315: error: `_Inout_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:316: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:320: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:321: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:322: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:323: error: `nSize' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:323: error: `_Out_writes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:324: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:325: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:329: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:330: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:331: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:332: error: `nSize' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:332: error: `_Out_writes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:333: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:334: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:344: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:345: error: `cb' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:345: error: `_Out_writes_bytes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:346: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:347: error: `_Out_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:348: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:353: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:354: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:355: error: `nSize' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:355: error: `_Out_writes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:356: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:357: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:361: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:362: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:363: error: `nSize' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:363: error: `_Out_writes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:364: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:365: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:376: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:377: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:378: error: `nSize' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:378: error: `_Out_writes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:379: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:380: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:384: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:385: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:386: error: `nSize' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:386: error: `_Out_writes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:387: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:388: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:499: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:500: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:501: error: `nSize' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:501: error: `_Out_writes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:502: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:503: error: initializer expression list treated as compound expression
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:507: warning: `__stdcall__' attribute only applies to function types
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:508: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:509: error: `nSize' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:509: error: `_Out_writes_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:510: error: `_In_' was not declared in this scope
    C:/Program Files (x86)/Windows Kits/8.0/Include/um/Psapi.h:511: error: initializer expression list treated as compound expression

来源:https://stackoverflow.com/questions/13970345/enumprocessmodulesex-missing-in-psapi-h

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!