Skip to content

Instantly share code, notes, and snippets.

@blogdarkspot
Created July 13, 2017 01:49
Show Gist options
  • Save blogdarkspot/70b6381a108485cca2f873ff27357087 to your computer and use it in GitHub Desktop.
Save blogdarkspot/70b6381a108485cca2f873ff27357087 to your computer and use it in GitHub Desktop.
Service *pService = NULL;
DECLSPEC bool StartDLL()
{
bool ret = true;
if(!pService)
{
if(!(pService = Service::getInstance()))
{
ret = false;
}
}
return ret;
}
DECLSPEC bool StopDLL()
{
bool ret = true;
if(pService)
{
if(pService->stop())
{
delete pSerivce;
pService = NULL;
}
else
{
ret = false;
}
}
return ret;
}
DECLSPEC bool InjectMock(void *mock)
{
bool ret = true;
pService = static_cast<Service*>(mock);
if(!pService)
{
ret = false;
}
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment