If you don't want to use the svlCVAPI.c/h files you can use GetProcAddress() to find the interface functions in the Coverage Validator DLL.
The interface functions have different names and do not use C++ name mangling, but have identical parameters to the API functions.
To determine the function name take any native API name, replace the leading cv with api. For example cvGetCollect() becomes apiGetCollect();
Example usage
typedef int (__cdecl *apiGetCollect_FUNC)();
HMODULE getValidatorModule()
{
HMODULE hModule;
hModule = GetModuleHandle(_T("svlCoverageThreadValidatorStub6432.dll")); // 32 bit DLL with 64 bit Coverage Validator GUI
if (hModule == NULL)
hModule = GetModuleHandle(_T("svlCoverageValidatorStub_x64.dll")); // 64 bit DLL with 64 bit Coverage Validator GUI
if (hModule == NULL)
hModule = GetModuleHandle(_T("svlCoverageValidatorStub.dll")); // 32 bit DLL with 32 bit Coverage Validator GUI
return hModule;
}
HMODULE hMod;
// get module, will only succeed if Coverage Validator launched this app or is injected into this app
hMod = getValidatorModule();
if (hMod != NULL)
{
// CV is present, lookup the function and call it to get the data collection status
apiGetCollect_FUNC theFunc;
theFunc = (apiGetCollect_FUNC)getFunctionFromValidatorModule("apiGetCollect");
if (theFunc != NULL)
return (*theFunc)();
}
For any API functions not listed, try looking up the name in svlCoverageValidatorStub.dll using depends.exe or PE File Browser.
You may see some other functions exported from svlPerformanceValidatorStub.dll(_x64).dll.
These other functions are for Performance Validator's use. Using them may damage memory locations and/or crash your code. Best not to use them!