git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4557 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.9.8
@@ -141,28 +141,31 @@ static char jack_shm_server_prefix[JACK_SERVER_NAME_SIZE] = ""; | |||
static int semid = -1; | |||
#ifdef WIN32 | |||
static bool check_process_running(DWORD process_id) | |||
{ | |||
DWORD aProcesses [2048], cbNeeded, cProcesses; | |||
#ifdef WIN32 | |||
#include <psapi.h> | |||
#include <lmcons.h> | |||
static BOOL check_process_running(DWORD process_id) | |||
{ | |||
DWORD aProcesses[2048], cbNeeded, cProcesses; | |||
unsigned int i; | |||
// Enumerate all processes | |||
if (!EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded)) { | |||
return false; | |||
return FALSE; | |||
} | |||
// Calculate how many process identifiers were returned. | |||
cProcesses = cbNeeded / sizeof(DWORD); | |||
for (i = 0; i < cProcesses; i++) { | |||
if (aProcesses [i] == dwProcessID) { | |||
for (i = 0; i < cProcesses; i++) { | |||
if (aProcesses[i] == process_id) { | |||
// Process process_id is running... | |||
return true; | |||
return TRUE; | |||
} | |||
} | |||
return false; | |||
return FALSE; | |||
} | |||
static int | |||
@@ -310,9 +313,18 @@ jack_shm_validate_registry () | |||
*/ | |||
static void | |||
jack_set_server_prefix (const char *server_name) | |||
{ | |||
snprintf (jack_shm_server_prefix, sizeof (jack_shm_server_prefix), | |||
"jack-%d:%s:", GetUID(), server_name); | |||
{ | |||
#ifdef WIN32 | |||
char buffer[UNLEN+1]={0}; | |||
DWORD len = UNLEN+1; | |||
GetUserName(buffer, &len); | |||
snprintf (jack_shm_server_prefix, sizeof (jack_shm_server_prefix), | |||
"jack-%s:%s:", buffer, server_name); | |||
#else | |||
snprintf (jack_shm_server_prefix, sizeof (jack_shm_server_prefix), | |||
"jack-%d:%s:", GetUID(), server_name); | |||
#endif | |||
} | |||
/* gain server addressability to shared memory registration segment | |||
@@ -490,7 +502,7 @@ jack_register_server (const char *server_name, int new_registry) | |||
/* See if server_name already registered. Since server names | |||
* are per-user, we register the unique server prefix string. | |||
*/ | |||
for (i = 0; i < MAX_SERVERS; i++) { | |||
for (i = 0; i < MAX_SERVERS; i++) { | |||
if (strncmp (jack_shm_header->server[i].name, | |||
jack_shm_server_prefix, | |||
@@ -535,7 +547,7 @@ jack_register_server (const char *server_name, int new_registry) | |||
jack_shm_header->server[i].pid = GetPID(); | |||
strncpy (jack_shm_header->server[i].name, | |||
jack_shm_server_prefix, | |||
JACK_SERVER_NAME_SIZE); | |||
JACK_SERVER_NAME_SIZE); | |||
unlock: | |||
jack_shm_unlock_registry (); | |||
@@ -599,7 +611,7 @@ jack_cleanup_shm () | |||
/* see if allocator still exists */ | |||
#ifdef WIN32 // steph | |||
jack_info("TODO: kill API not available !!"); | |||
//jack_info("TODO: kill API not available !!"); | |||
#else | |||
if (kill (r->allocator, 0)) { | |||
if (errno == ESRCH) { | |||
@@ -1,14 +1,14 @@ | |||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | |||
<CodeBlocks_workspace_file> | |||
<Workspace title="jack"> | |||
<Project filename="libjackserver.cbp" active="1" /> | |||
<Project filename="libjackserver.cbp" /> | |||
<Project filename="jack_portaudio.cbp" /> | |||
<Project filename="jack_netdriver.cbp" /> | |||
<Project filename="jack_netonedriver.cbp" /> | |||
<Project filename="jack_dummy.cbp" /> | |||
<Project filename="jack_netmanager.cbp" /> | |||
<Project filename="jack_audioadapter.cbp" /> | |||
<Project filename="libjack.cbp" /> | |||
<Project filename="libjack.cbp" active="1" /> | |||
<Project filename="jack_load.cbp" /> | |||
<Project filename="jack_unload.cbp" /> | |||
<Project filename="jack_lsp.cbp" /> | |||
@@ -25,7 +25,7 @@ | |||
<Add option="-DREGEX_MALLOC" /> | |||
<Add option="-DSTDC_HEADERS" /> | |||
<Add option="-D__SMP__" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DHAVE_CONFIG_H" /> | |||
<Add directory="." /> | |||
<Add directory="..\windows" /> | |||
@@ -47,6 +47,7 @@ | |||
<Add library="uuid" /> | |||
<Add library="odbc32" /> | |||
<Add library="odbccp32" /> | |||
<Add library="psapi" /> | |||
</Linker> | |||
</Target> | |||
<Target title="Win32 Debug 64bits"> | |||
@@ -68,7 +69,7 @@ | |||
<Add option="-DREGEX_MALLOC" /> | |||
<Add option="-DSTDC_HEADERS" /> | |||
<Add option="-D__SMP__" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DHAVE_CONFIG_H" /> | |||
<Add directory="." /> | |||
<Add directory="..\windows" /> | |||
@@ -90,6 +91,7 @@ | |||
<Add library="uuid" /> | |||
<Add library="odbc32" /> | |||
<Add library="odbccp32" /> | |||
<Add library="psapi" /> | |||
</Linker> | |||
</Target> | |||
<Target title="Win32 Profiling 64bits"> | |||
@@ -111,7 +113,7 @@ | |||
<Add option="-DREGEX_MALLOC" /> | |||
<Add option="-DSTDC_HEADERS" /> | |||
<Add option="-D__SMP__" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_MONITOR" /> | |||
<Add option="-DHAVE_CONFIG_H" /> | |||
<Add directory="." /> | |||
@@ -134,6 +136,7 @@ | |||
<Add library="uuid" /> | |||
<Add library="odbc32" /> | |||
<Add library="odbccp32" /> | |||
<Add library="psapi" /> | |||
</Linker> | |||
</Target> | |||
<Target title="Win32 Release 32bits"> | |||
@@ -156,7 +159,7 @@ | |||
<Add option="-DREGEX_MALLOC" /> | |||
<Add option="-DSTDC_HEADERS" /> | |||
<Add option="-D__SMP__" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DHAVE_CONFIG_H" /> | |||
<Add directory="." /> | |||
<Add directory="..\windows" /> | |||
@@ -179,6 +182,7 @@ | |||
<Add library="uuid" /> | |||
<Add library="odbc32" /> | |||
<Add library="odbccp32" /> | |||
<Add library="psapi" /> | |||
</Linker> | |||
<ExtraCommands> | |||
<Add before="windres -F pe-i386 -O coff -o Release/libjack.res libjack.rc" /> | |||
@@ -204,7 +208,7 @@ | |||
<Add option="-DREGEX_MALLOC" /> | |||
<Add option="-DSTDC_HEADERS" /> | |||
<Add option="-D__SMP__" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DHAVE_CONFIG_H" /> | |||
<Add directory="." /> | |||
<Add directory="..\windows" /> | |||
@@ -227,6 +231,7 @@ | |||
<Add library="uuid" /> | |||
<Add library="odbc32" /> | |||
<Add library="odbccp32" /> | |||
<Add library="psapi" /> | |||
</Linker> | |||
<ExtraCommands> | |||
<Add before="windres -F pe-i386 -O coff -o Debug/libjack.res libjack.rc" /> | |||
@@ -252,7 +257,7 @@ | |||
<Add option="-DREGEX_MALLOC" /> | |||
<Add option="-DSTDC_HEADERS" /> | |||
<Add option="-D__SMP__" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_MONITOR" /> | |||
<Add option="-DHAVE_CONFIG_H" /> | |||
<Add directory="." /> | |||
@@ -276,6 +281,7 @@ | |||
<Add library="uuid" /> | |||
<Add library="odbc32" /> | |||
<Add library="odbccp32" /> | |||
<Add library="psapi" /> | |||
</Linker> | |||
<ExtraCommands> | |||
<Add before="windres -F pe-i386 -O coff -o Release/libjack.res libjack.rc" /> | |||
@@ -26,8 +26,8 @@ | |||
<Add option="-DSTDC_HEADERS" /> | |||
<Add option="-DSERVER_SIDE" /> | |||
<Add option="-D__SMP__" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DHAVE_CONFIG_H" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DHAVE_CONFIG_H" /> | |||
<Add directory="." /> | |||
<Add directory="..\windows" /> | |||
<Add directory="..\common\jack" /> | |||
@@ -36,6 +36,7 @@ | |||
<Add directory="tre-0.8.0\lib" /> | |||
</Compiler> | |||
<Linker> | |||
<Add library="psapi" /> | |||
<Add directory="Release\bin64" /> | |||
</Linker> | |||
</Target> | |||
@@ -59,7 +60,7 @@ | |||
<Add option="-DSTDC_HEADERS" /> | |||
<Add option="-DSERVER_SIDE" /> | |||
<Add option="-D__SMP__" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DHAVE_CONFIG_H" /> | |||
<Add directory="." /> | |||
<Add directory="..\windows" /> | |||
@@ -69,6 +70,7 @@ | |||
<Add directory="tre-0.8.0\lib" /> | |||
</Compiler> | |||
<Linker> | |||
<Add library="psapi" /> | |||
<Add directory="Debug\bin64" /> | |||
</Linker> | |||
</Target> | |||
@@ -92,7 +94,7 @@ | |||
<Add option="-DSTDC_HEADERS" /> | |||
<Add option="-DSERVER_SIDE" /> | |||
<Add option="-D__SMP__" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_MONITOR" /> | |||
<Add option="-DHAVE_CONFIG_H" /> | |||
<Add directory="." /> | |||
@@ -103,6 +105,7 @@ | |||
<Add directory="tre-0.8.0\lib" /> | |||
</Compiler> | |||
<Linker> | |||
<Add library="psapi" /> | |||
<Add directory="Release\bin64" /> | |||
</Linker> | |||
</Target> | |||
@@ -127,7 +130,7 @@ | |||
<Add option="-DSTDC_HEADERS" /> | |||
<Add option="-DSERVER_SIDE" /> | |||
<Add option="-D__SMP__" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DHAVE_CONFIG_H" /> | |||
<Add directory="." /> | |||
<Add directory="..\windows" /> | |||
@@ -138,6 +141,7 @@ | |||
</Compiler> | |||
<Linker> | |||
<Add option="-m32" /> | |||
<Add library="psapi" /> | |||
<Add directory="Release\bin" /> | |||
</Linker> | |||
<ExtraCommands> | |||
@@ -165,7 +169,7 @@ | |||
<Add option="-DSTDC_HEADERS" /> | |||
<Add option="-DSERVER_SIDE" /> | |||
<Add option="-D__SMP__" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DHAVE_CONFIG_H" /> | |||
<Add directory="." /> | |||
<Add directory="..\windows" /> | |||
@@ -176,6 +180,7 @@ | |||
</Compiler> | |||
<Linker> | |||
<Add option="-m32" /> | |||
<Add library="psapi" /> | |||
<Add directory="Debug\bin" /> | |||
</Linker> | |||
<ExtraCommands> | |||
@@ -203,7 +208,7 @@ | |||
<Add option="-DSTDC_HEADERS" /> | |||
<Add option="-DSERVER_SIDE" /> | |||
<Add option="-D__SMP__" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_32_64" /> | |||
<Add option="-DJACK_MONITOR" /> | |||
<Add option="-DHAVE_CONFIG_H" /> | |||
<Add directory="." /> | |||
@@ -215,6 +220,7 @@ | |||
</Compiler> | |||
<Linker> | |||
<Add option="-m32" /> | |||
<Add library="psapi" /> | |||
<Add directory="Release\bin" /> | |||
</Linker> | |||
<ExtraCommands> | |||
@@ -247,7 +253,6 @@ | |||
<Unit filename="..\common\JackActivationCount.cpp" /> | |||
<Unit filename="..\common\JackArgParser.cpp" /> | |||
<Unit filename="..\common\JackAudioDriver.cpp" /> | |||
<Unit filename="..\common\JackTimedDriver.cpp" /> | |||
<Unit filename="..\common\JackAudioPort.cpp" /> | |||
<Unit filename="..\common\JackClient.cpp" /> | |||
<Unit filename="..\common\JackConnectionManager.cpp" /> | |||
@@ -287,6 +292,7 @@ | |||
<Unit filename="..\common\JackServerGlobals.cpp" /> | |||
<Unit filename="..\common\JackShmMem.cpp" /> | |||
<Unit filename="..\common\JackThreadedDriver.cpp" /> | |||
<Unit filename="..\common\JackTimedDriver.cpp" /> | |||
<Unit filename="..\common\JackTools.cpp" /> | |||
<Unit filename="..\common\JackTransportEngine.cpp" /> | |||
<Unit filename="..\common\JackWaitThreadedDriver.cpp" /> | |||