adding initial win32 build files and service test. will have a long way to go before a completed win32 release is ready

git-svn-id: svn+ssh://svn.code.sf.net/p/spacenav/code/trunk/spacenavd@172 ef983eb1-d774-4af8-acfd-baaf7b16a646
pull/1/head
John Tsiombikas 2013-07-11 17:59:25 +00:00
rodzic 456a6410af
commit 8590a7e1c0
3 zmienionych plików z 263 dodań i 0 usunięć

20
spacenavd.sln 100644
Wyświetl plik

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spacenavd", "spacenavd.vcproj", "{C1F098DD-4900-4820-98D5-4601340C8F90}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C1F098DD-4900-4820-98D5-4601340C8F90}.Debug|Win32.ActiveCfg = Debug|Win32
{C1F098DD-4900-4820-98D5-4601340C8F90}.Debug|Win32.Build.0 = Debug|Win32
{C1F098DD-4900-4820-98D5-4601340C8F90}.Release|Win32.ActiveCfg = Release|Win32
{C1F098DD-4900-4820-98D5-4601340C8F90}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

181
spacenavd.vcproj 100644
Wyświetl plik

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="spacenavd"
ProjectGUID="{C1F098DD-4900-4820-98D5-4601340C8F90}"
RootNamespace="spacenavd"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="src"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\src\spnavd_win32.c"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

62
src/spnavd_win32.c 100644
Wyświetl plik

@ -0,0 +1,62 @@
#ifdef WIN32
#include <stdio.h>
#include <windows.h>
static void WINAPI svc_main(unsigned long argc, char **argv);
static unsigned long WINAPI svc_handler(unsigned long op, unsigned long evtype, void *evdata, void *cls);
static SERVICE_STATUS_HANDLE svc;
int main(int argc, char **argv)
{
SERVICE_TABLE_ENTRY serv_tbl[] = {
{"", svc_main},
{0, 0}
};
if(!StartServiceCtrlDispatcher(serv_tbl)) {
fprintf(stderr, "failed to start the spacenavd service\n");
return 1;
}
return 0;
}
static void WINAPI svc_main(unsigned long argc, char **argv)
{
SERVICE_STATUS status;
svc = RegisterServiceCtrlHandlerEx("spacenavd", svc_handler, 0);
status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
status.dwCurrentState = SERVICE_START_PENDING;
status.dwControlsAccepted = SERVICE_ACCEPT_STOP;
status.dwWin32ExitCode = 0;
status.dwCheckPoint = 0;
status.dwWaitHint = 2000;
SetServiceStatus(svc, &status);
/* init */
status.dwCurrentState = SERVICE_RUNNING;
SetServiceStatus(svc, &status);
}
static unsigned long WINAPI svc_handler(unsigned long op, unsigned long evtype, void *evdata, void *cls)
{
printf("received service control message: %ld\n", op);
switch(op) {
case SERVICE_CONTROL_INTERROGATE:
return 0;
case SERVICE_CONTROL_STOP:
exit(0);
default:
break;
}
return ERROR_CALL_NOT_IMPLEMENTED;
}
#else
int spnavd_win32_silcence_empty_file_warnings = 1;
#endif