微软曾开源过一个操作系统SID修改工具.
我从网上下载回来了.但无法编译通过..到底是没学过C++
麻烦帮忙看一下.请教下如何编译..
报错信息:
Compiling...
sid.cpp
c:\test\sid.h(69) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier
c:\test\sid.h(69) : error C2146: syntax error : missing ')' before identifier 'NameType'
c:\test\sid.h(69) : error C2165: 'left-side modifier' : cannot modify pointers to data
c:\test\sid.h(69) : error C2071: 'SETCOMPUTERNAMEEX' : illegal storage class
c:\test\sid.h(71) : error C2059: syntax error : ')'
c:\test\sid.cpp(94) : error C2664: 'swprintf' : cannot convert parameter 1 from 'char [256]' to 'unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(123) : error C2664: 'wcslen' : cannot convert parameter 1 from 'char *' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(768) : error C2664: 'GetRegSecDesc' : cannot convert parameter 2 from 'unsigned short [9]' to 'char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(774) : error C2664: 'RegOpenKeyA' : cannot convert parameter 2 from 'unsigned short [29]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(777) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [48]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(782) : error C2664: 'SetRegAccess' : cannot convert parameter 2 from 'unsigned short [29]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(786) : error C2664: 'RegQueryValueExA' : cannot convert parameter 2 from 'unsigned short [2]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(788) : error C2664: 'RegQueryValueExA' : cannot convert parameter 2 from 'unsigned short [2]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(792) : error C2664: 'SetRegAccess' : cannot convert parameter 2 from 'unsigned short [29]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(794) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [48]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(806) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [61]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(901) : error C2664: 'ChangeComputerSID' : cannot convert parameter 2 from 'unsigned short [9]' to 'char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(908) : error C2664: 'ChangeComputerSID' : cannot convert parameter 2 from 'unsigned short [34]' to 'char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(925) : error C2664: 'ChangeComputerSID' : cannot convert parameter 2 from 'unsigned short [57]' to 'char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(931) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [97]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(947) : error C2065: 'ComputerNamePhysicalDnsHostname' : undeclared identifier
c:\test\sid.cpp(986) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [102]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1077) : error C2065: '_beginthread' : undeclared identifier
c:\test\sid.cpp(1247) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [67]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1256) : error C2664: 'RegOpenKeyA' : cannot convert parameter 2 from 'unsigned short [29]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1260) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [55]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1269) : error C2664: 'SetRegAccess' : cannot convert parameter 2 from 'unsigned short [29]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1272) : error C2664: 'RegQueryValueExA' : cannot convert parameter 2 from 'unsigned short [2]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1274) : error C2664: 'RegQueryValueExA' : cannot convert parameter 2 from 'unsigned short [2]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1278) : error C2664: 'SetRegAccess' : cannot convert parameter 2 from 'unsigned short [29]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1280) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [55]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1294) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [68]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1316) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [47]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1725) : error C2664: 'DisplayError' : cannot convert parameter 1 from 'unsigned short [75]' to 'char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1734) : error C2664: 'DisplayError' : cannot convert parameter 1 from 'unsigned short [75]' to 'char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1741) : error C2664: 'DisplayError' : cannot convert parameter 1 from 'unsigned short [75]' to 'char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1751) : error C2664: 'CommandLineToArgvW' : cannot convert parameter 1 from 'char *' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1752) : error C2664: 'ProcessArguments' : cannot convert parameter 2 from 'unsigned short ** ' to 'char *[]'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
执行 cl.exe 时出错.
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)