microsoft / krabsetw

KrabsETW provides a modern C++ wrapper and a .NET wrapper around the low-level ETW trace consumption functions.
Other
605 stars 149 forks source link

KERNEL_LOGGER_NAME define issue #52

Closed randodev closed 5 years ago

randodev commented 6 years ago

Hi! I'm using the NuGet 1.0.12 package, wrote a simple script just to import , and get the following error: no suitable constructor exists to convert from "const char [17]" to "std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>>"

in kt.hpp:100

Am I doing anything wrong?

Thanks!

zacbrown commented 6 years ago

Looks like you’re using ASCII string (char/std::string). Krabsetw only supports wide strings (wchar_t/std::wstring).

randodev commented 6 years ago

I don't understand the reply. I'm not using ASCII strings. I only wrote the following:

int main()
{
    krabs::user_trace user;
    return 0;
}

and got the error. the error is in a krabs file (kt.hpp).

What should I change in Visual Studio?

zacbrown commented 6 years ago

Can you post the VS project somewhere I can look at it?

randodev commented 6 years ago

I'm figuring it out slowly. The problem is on this line return KERNEL_LOGGER_NAME; that define is in evntrace.h which depends on Target Platform Version

Tried both 8.1 and 10.0.17134.0

Here is the shared project: https://github.com/randodev/TestETW

zacbrown commented 6 years ago

Hi - which version of Visual Studio are you using? I wasn't able to reproduce the error with a clean project from Visual Studio 2017.

randodev commented 6 years ago

Hi. It's Microsoft Visual Studio Professional 2017 - 15.7.6

zacbrown commented 6 years ago

Thanks - I'm not able to reproduce an error with that one. Are you building x64?

I did find a separate error - but it's related to C++ 17 language issues that were fixed in a recent change. Package isn't created yet for it but I opened #53 for that work.

swannman commented 6 years ago

@randodev does this still repro with the latest bits?

swannman commented 5 years ago

@randodev please reopen if this still repros for you. Thanks!