int CALLBACK WinMain(
_In_ HINSTANCE hInstance,
- _In_opt_ HINSTANCE ignore,
+ _In_opt_ HINSTANCE hPrevious,
_In_ LPSTR lpCmdLine,
_In_ int nCmdShow)
{
+ UNREFERENCED_PARAMETER(hInstance);
+ UNREFERENCED_PARAMETER(hPrevious);
+ UNREFERENCED_PARAMETER(nCmdShow);
+
if (strlen(lpCmdLine) != 0) {
if (!strcmp(lpCmdLine, "-i") || !strcmp(lpCmdLine, "\"-i\""))
return CXenAgent::ServiceInstall();
if (GetModuleFileNameA(NULL, path, MAX_PATH) == 0) {
CloseServiceHandle(mgr);
- return GetLastError();
+ return -1;
}
path[MAX_PATH] = 0;
if (!StartServiceCtrlDispatcher(ServiceTable)) {
CXenAgent::Log("Failed to start dispatcher\n");
- return GetLastError();
+ return -1;
}
return 0;
}
if (lr != ERROR_SUCCESS)
goto fail1;
- long size = 32;
+ DWORD size = 32;
DWORD length;
char* buffer = NULL;
void WINAPI CXenAgent::__ServiceMain(int argc, char** argv)
{
+ UNREFERENCED_PARAMETER(argc);
+ UNREFERENCED_PARAMETER(argv);
+
m_handle = RegisterServiceCtrlHandlerEx(SVC_NAME, ServiceControlHandlerEx, NULL);
if (m_handle == NULL)
return;
DWORD WINAPI CXenAgent::__ServiceControlHandlerEx(DWORD req, DWORD evt, LPVOID data, LPVOID ctxt)
{
+ UNREFERENCED_PARAMETER(ctxt);
+
switch (req)
{
case SERVICE_CONTROL_STOP:
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;__MODULE__="XENAGENT";%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>EnableAllWarnings</WarningLevel>
+ <DisableSpecificWarnings>4127;4350;4711;4548;4820;4668;4255;6001;6054;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnablePREfast>true</EnablePREfast>
<RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;__MODULE__="XENAGENT";%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>EnableAllWarnings</WarningLevel>
+ <DisableSpecificWarnings>4127;4350;4711;4548;4820;4668;4255;6001;6054;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnablePREfast>true</EnablePREfast>
<RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary>