1.dll
的GetMachineInfo
public unsafe string GetMachineInfo(string guardServerInfo)
{
LicenseService
*
ptr
=
<Module>.@new(
2056UL
);
LicenseService
*
ptr2;
try
{
ptr2
=
((ptr
=
=
null) ? null : <Module>.LicenseService.{ctor}(ptr));
}
catch
{
<Module>.delete((void
*
)ptr);
throw;
}
LicenseService
*
ptr3
=
ptr2;
basic_string<char,std::char_traits<char>,std::allocator<char>\u0020> basic_string<char,std::char_traits<char>,std::allocator<char>_u0020>;
basic_string<char,std::char_traits<char>,std::allocator<char>\u0020>
*
ptr4
=
<Module>.ConvertStringClrToStd(&basic_string<char,std::char_traits<char>,std::allocator<char>_u0020>, guardServerInfo);
basic_string<char,std::char_traits<char>,std::allocator<char>\u0020> basic_string<char,std::char_traits<char>,std::allocator<char>_u0020>
2
;
<Module>.LicenseService.GetMachineInfo(ptr3, &basic_string<char,std::char_traits<char>,std::allocator<char>_u0020>
2
, (basic_string<char,std::char_traits<char>,std::allocator<char>\u0020>
*
)ptr4);
string result;
try
{
LicenseService
*
ptr5
=
ptr3;
if
(ptr5 !
=
null)
{
void
*
ptr6
=
<Module>.LicenseService.__delDtor(ptr5,
1U
);
}
result
=
new string(<Module>.std.basic_string<char,std::char_traits<char>,std::allocator<char>\u0020>.c_str(ref basic_string<char,std::char_traits<char>,std::allocator<char>_u0020>
2
));
}
catch
{
<Module>.___CxxCallUnwindDtor(ldftn(std.basic_string<char,std::char_traits<char>,std::allocator<char>\u0020>.{dtor}), (void
*
)(&basic_string<char,std::char_traits<char>,std::allocator<char>_u0020>
2
));
throw;
}
<Module>.std.basic_string<char,std::char_traits<char>,std::allocator<char>\u0020>.{dtor}(ref basic_string<char,std::char_traits<char>,std::allocator<char>_u0020>
2
);
return
result;
}
API调用
[SuppressUnmanagedCodeSecurity]
[DllImport("", CallingConvention
=
CallingConvention.Cdecl, SetLastError
=
true)]
[MethodImpl(MethodImplOptions.Unmanaged)]
public unsafe static extern basic_string<char,std::char_traits<char>,std::allocator<char>\u0020>
*
GetMachineInf