Closed ddkwork closed 4 years ago
You can't use STL in driver or Boost or any other user-mode libraries until they are ported to kernel mode.
在将STL移植到内核模式之前,不能在驱动程序或Boost或任何其他用户模式库中使用STL。
Some info: https://github.com/zer0mem/libc
https://github.com/wbenny/hvpp https://github.com/tandasat/DdiMon
They are used stl in kernel. I'd like use findwdk for build them,Thx.
I was created some stl packge like golang: Strings,bytes,hex,fmt....etc. Finally i can't write std::bind function..if findwd build stl well that's very cool.
like this: https://github.com/DiskGetor/CppSysLIB
https://github.com/wbenny/hvpp doesn't use STL in a driver, it uses it only in a user-mode app.
https://github.com/zer0mem/libc is a CRT for running C++ in kernel mode but it lacks exceptions and a lot of C++ libraries use exceptions. Also it's bad to use exceptions in kernel mode as it takes too much memory and can cause stack overflows (as stack is very limited in kernel mode). We experimented with that in the past.
https://github.com/tandasat/DdiMon uses some parts of STL (like $(VC_IncludePath)
.
No one uses std::string
in drivers as it throw exceptions. You need to use exception free STL (I saw that some guys use EASTL but I have no experience with it). Or you can write your own library.
std::string a="333333": DbgPrint(a.c_str);