use VMProtectEnd(); appear UnpairedVMProtectEnd

my code is

void GetDa(Pak* buf)
{

VMProtectBeginUltra(“VMP14”);
if (NULL == buf)
{
canlock = FALSE;
GetResText = 0;
FontTable = 0;
}
else
{
canlock = TRUE;
}

VMProtectEnd();
}

after compile. VMProtectEnd() become two call.
so protected note me UnpairedVMProtectEnd

void GetDa(Pak* buf)
{

VMProtectBeginUltra
if (NULL == buf)
{
canlock = FALSE;
GetResText = 0;
FontTable = 0;
}
else
{
canlock = TRUE;
}

VMProtectEnd
}

use MACRO marker no problem

The reason of this situation in optiomization:

VMProtectBeginUltra

VMProtectEnd

VMProtectEnd

Try to disable the optimization for this block of code.

i konw The reason is optiomization:

but use MACRO Marker is OK

so i hope continue use MACRO.

how to disable the optimization for one block?

in MSVC++

#pragma optimize( “g”, off )

// code

#pragma optimize( “g”, on )