Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What version of SDK and WDK was used for compilation? #46

Open
ryuj-h opened this issue Mar 11, 2021 · 8 comments
Open

What version of SDK and WDK was used for compilation? #46

ryuj-h opened this issue Mar 11, 2021 · 8 comments

Comments

@ryuj-h
Copy link

ryuj-h commented Mar 11, 2021

VS2017
SDK -10.0.17763.0
WDK - Windows 10, version 1809

Compile- tons of error

Can anyone tell me the development environment?

@warchiefmarkus
Copy link

warchiefmarkus commented Mar 16, 2021

I use VS 2019 (latest updates), WDK - Win10 (latest), have 4 errors (with non initialized members in constexpr) and missed types (const unsigned short [18]" в "PWCH"). I disable warning levels and set C++ standart to latest possible ( 17+).
So Im also interested in build details and builded release in repository please.

@warchiefmarkus
Copy link

warchiefmarkus commented Mar 31, 2021

I built it , but need look aon project from home to remember :) i found some snippet for constexpr replace , its visual studio 2019 last version problem related with constexpr.

@b1tg
Copy link

b1tg commented May 26, 2021

@warchiefmarkus, the constexpr issue was fixed in Visual Studio 2019 version 16.10.0 . How did you solved the missed types (const unsigned short [18]" в "PWCH") issue?

@warchiefmarkus
Copy link

@warchiefmarkus, the constexpr issue was fixed in Visual Studio 2019 version 16.10.0 . How did you solved the missed types (const unsigned short [18]" в "PWCH") issue?

Just casting

@b1tg
Copy link

b1tg commented Jun 3, 2021

@warchiefmarkus, the constexpr issue was fixed in Visual Studio 2019 version 16.10.0 . How did you solved the missed types (const unsigned short [18]" в "PWCH") issue?

Just casting

thanks :)

@ansnapx
Copy link

ansnapx commented Aug 12, 2021

  1. VS2017 with Win8.1 SDK and WinSDK 10.0.17763.0
  2. WDK 10.0.17763.1
  3. /WX-

If you get some error in vmexit_c_wrapper.cpp and the vmexit_passthrough.cpp. please modify it as follow:

  1. vmexit_passthrough.cpp
    static const uint8_t* skip_prefixes(const uint8_t* first, const uint8_t* last) noexcept
    {
    //
    // Return the first byte of the opcode that is not a prefix.
    //
    return std::find_if(first, last, [&](uint8_t byte){
    //
    // List of prefix types that should be skipped, LOCK is not included as it'd #UD.
    //
    static constexpr uint8_t skip_table[] = {
    0xF2, 0xF3, 0x2E, 0x36, 0x3E, 0x26, 0x64, 0x65, 0x2E, 0x3E, 0x66, 0x67
    };
    return std::find(std::begin(skip_table), std::end(skip_table), byte) == std::end(skip_table);
    }); // TODO add the );
    }

  2. vmexit_c_wrapper.cpp
    auto vmexit_c_wrapper_handler::setup(vcpu_t& vp) noexcept -> error_code_t
    {
    if (setup_callback_)
    {
    //
    // C-handler has been defined - call that routine.
    //

    //auto context = passthrough_context{
    // .passthrough_routine = passthrough_fn_t(&vmexit_c_wrapper_handler::handle_passthrough_setup),
    // .context = context_,
    // .handler_instance = this,
    // .handler_method = nullptr,
    // .vcpu = &vp,
    //};

    passthrough_context context;
    context.passthrough_routine = passthrough_fn_t(&vmexit_c_wrapper_handler::handle_passthrough_setup);
    context.context = context_;
    context.handler_instance = this;
    context.handler_method = nullptr;
    context.vcpu = &vp;

    return (error_code_t)setup_callback_(&vp, &context);
    }
    else
    {
    //
    // C-handler has not been defined - call the pass-through handler.
    //

    return base_type::setup(vp);
    }
    }

void vmexit_c_wrapper_handler::teardown(vcpu_t& vp) noexcept
{
if (teardown_callback_)
{
//
// C-handler has been defined - call that routine.
//

//auto context = passthrough_context{
//  .passthrough_routine = passthrough_fn_t(&vmexit_c_wrapper_handler::handle_passthrough_teardown),
//  .context             = context_,
//  .handler_instance    = this,
//  .handler_method      = nullptr,
//  .vcpu                = &vp,
//};

passthrough_context context;
context.passthrough_routine = passthrough_fn_t(&vmexit_c_wrapper_handler::handle_passthrough_teardown);
context.context = context_;
context.handler_instance = this;
context.handler_method = nullptr;
context.vcpu = &vp;

teardown_callback_(&vp, &context);

}
else
{
//
// C-handler has not been defined - call the pass-through handler.
//

base_type::teardown(vp);

}
}

void vmexit_c_wrapper_handler::terminate(vcpu_t& vp) noexcept
{
if (terminate_callback_)
{
//
// C-handler has been defined - call that routine.
//

//auto context = passthrough_context{
//  .passthrough_routine = passthrough_fn_t(&vmexit_c_wrapper_handler::handle_passthrough_terminate),
//  .context             = context_,
//  .handler_instance    = this,
//  .handler_method      = nullptr,
//  .vcpu                = &vp,
//};

passthrough_context context;
context.passthrough_routine = passthrough_fn_t(&vmexit_c_wrapper_handler::handle_passthrough_terminate);
context.context = context_;
context.handler_instance = this;
context.handler_method = nullptr;
context.vcpu = &vp;

terminate_callback_(&vp, &context);

}
else
{
//
// C-handler has not been defined - call the pass-through handler.
//

base_type::terminate(vp);

}
}

void vmexit_c_wrapper_handler::handle(vcpu_t& vp) noexcept
{
const auto exit_reason = vp.exit_reason();
const auto exit_reason_index = static_cast(exit_reason);

const auto cpp_handler = handlers_[exit_reason_index];
const auto c_handler = c_handlers_[exit_reason_index];

if (c_handler)
{
//
// C-handler has been defined - call that routine.
//

//auto context = passthrough_context{
//  .passthrough_routine = passthrough_fn_t(&vmexit_c_wrapper_handler::handle_passthrough_handler),
//  .context             = context_,
//  .handler_instance    = this,
//  .handler_method      = cpp_handler,
//  .vcpu                = &vp,
//};

passthrough_context context;
context.passthrough_routine = passthrough_fn_t(&vmexit_c_wrapper_handler::handle_passthrough_handler);
context.context = context_;
context.handler_instance = this;
context.handler_method = nullptr;
context.vcpu = &vp;

c_handler(&vp, &context);

}
else
{
//
// C-handler has not been defined - call the pass-through handler.
//

(this->*cpp_handler)(vp);

}
}

noW , YOU can build it success.

@warchiefmarkus
Copy link

As far as I know, in a recent release, Visual Studio has fixed the constexpr issue

@manurautela
Copy link

3. /WX-

@ansnapx Instead of /WX- using /IGNORE:warning[,warning] would be better option.
Mentioned in issue #45 . This would disable specific linker warning instead of all.

https://docs.microsoft.com/en-us/cpp/build/reference/ignore-ignore-specific-warnings?view=msvc-160

@warchiefmarkus On 16.10.4 at least the issue is still present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants