summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-14 15:51:34 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-14 15:51:34 +0000
commite58823d961a630eb62e60d2ccb443761ba5f1704 (patch)
tree62d071be480d57af2a53f154a1468abe0b9449ff /src/core
parent721aea0764451e985d575236205808bbef298244 (diff)
- all MS_CLIST_ADD*ITEM services replaced with Menu_Add*Item stubs.
- massive cleanup of the menu-related code git-svn-id: http://svn.miranda-ng.org/main/trunk@410 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core')
-rw-r--r--src/core/commonheaders.h4
-rw-r--r--src/core/forkthread.h16
-rw-r--r--src/core/memory.cpp2
-rw-r--r--src/core/miranda.cpp169
-rw-r--r--src/core/miranda.h10
-rw-r--r--src/core/modules.cpp44
-rw-r--r--src/core/modules.h46
7 files changed, 146 insertions, 145 deletions
diff --git a/src/core/commonheaders.h b/src/core/commonheaders.h
index c367fe9a78..e47ba25fb3 100644
--- a/src/core/commonheaders.h
+++ b/src/core/commonheaders.h
@@ -2,7 +2,7 @@
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
diff --git a/src/core/forkthread.h b/src/core/forkthread.h
index d920b7867e..2062192557 100644
--- a/src/core/forkthread.h
+++ b/src/core/forkthread.h
@@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -48,16 +48,16 @@ Cavets:
*/
UINT_PTR forkthread (
- void (__cdecl *threadcode)(void*),
- unsigned long stacksize,
+ void (__cdecl *threadcode)(void*),
+ unsigned long stacksize,
void *arg
);
UINT_PTR forkthreadex(
- void *sec,
- unsigned stacksize,
- unsigned (__stdcall *threadcode)(void*),
- void *owner,
- void *arg,
+ void *sec,
+ unsigned stacksize,
+ unsigned (__stdcall *threadcode)(void*),
+ void *owner,
+ void *arg,
unsigned *thraddr
);
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 04252e1c34..8dbb7b2ecc 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
diff --git a/src/core/miranda.cpp b/src/core/miranda.cpp
index e2335b27a9..2403b5aaf8 100644
--- a/src/core/miranda.cpp
+++ b/src/core/miranda.cpp
@@ -2,7 +2,7 @@
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2012 Miranda ICQ/IM project,
+Copyright 2000-2012 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -42,7 +42,7 @@ pfnMyMonitorFromRect MyMonitorFromRect;
pfnMyMonitorFromWindow MyMonitorFromWindow;
pfnMyGetMonitorInfo MyGetMonitorInfo;
-typedef DWORD (WINAPI *pfnMsgWaitForMultipleObjectsEx)(DWORD,CONST HANDLE*,DWORD,DWORD,DWORD);
+typedef DWORD (WINAPI *pfnMsgWaitForMultipleObjectsEx)(DWORD, CONST HANDLE*, DWORD, DWORD, DWORD);
pfnMsgWaitForMultipleObjectsEx msgWaitForMultipleObjectsEx;
pfnSHAutoComplete shAutoComplete;
@@ -84,16 +84,17 @@ LPFN_WSAADDRESSTOSTRINGA MyWSAAddressToString;
ITaskbarList3 * pTaskbarInterface;
-static DWORD MsgWaitForMultipleObjectsExWorkaround(DWORD nCount, const HANDLE *pHandles,
+static DWORD MsgWaitForMultipleObjectsExWorkaround(DWORD nCount, const HANDLE *pHandles,
DWORD dwMsecs, DWORD dwWakeMask, DWORD dwFlags);
-HANDLE hOkToExitEvent,hModulesLoadedEvent;
-static HANDLE hShutdownEvent,hPreShutdownEvent;
+HANDLE hOkToExitEvent, hModulesLoadedEvent;
+static HANDLE hShutdownEvent, hPreShutdownEvent;
static HANDLE hWaitObjects[MAXIMUM_WAIT_OBJECTS-1];
static char *pszWaitServices[MAXIMUM_WAIT_OBJECTS-1];
-static int waitObjectCount=0;
-HANDLE hStackMutex,hMirandaShutdown,hThreadQueueEmpty;
+static int waitObjectCount = 0;
+HANDLE hStackMutex, hMirandaShutdown, hThreadQueueEmpty;
HINSTANCE hMirandaInst;
+int hLangpack = 0;
/////////////////////////////////////////////////////////////////////////////////////////
// exception handling
@@ -148,7 +149,7 @@ void __cdecl forkthread_r(void * arg)
struct FORK_ARG * fa = (struct FORK_ARG *) arg;
void (*callercode)(void*)=fa->threadcode;
void * cookie=fa->arg;
- CallService(MS_SYSTEM_THREAD_PUSH,0,(LPARAM)callercode);
+ CallService(MS_SYSTEM_THREAD_PUSH, 0, (LPARAM)callercode);
SetEvent(fa->hEvent);
__try
{
@@ -160,24 +161,24 @@ void __cdecl forkthread_r(void * arg)
}
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
- CallService(MS_SYSTEM_THREAD_POP,0,0);
+ CallService(MS_SYSTEM_THREAD_POP, 0, 0);
return;
}
UINT_PTR forkthread (
- void (__cdecl *threadcode)(void*),
- unsigned long stacksize,
+ void (__cdecl *threadcode)(void*),
+ unsigned long stacksize,
void *arg
)
{
UINT_PTR rc;
struct FORK_ARG fa;
- fa.hEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
+ fa.hEvent=CreateEvent(NULL, FALSE, FALSE, NULL);
fa.threadcode=threadcode;
fa.arg=arg;
- rc=_beginthread(forkthread_r,stacksize,&fa);
+ rc=_beginthread(forkthread_r, stacksize, &fa);
if ((UINT_PTR)-1L != rc)
- WaitForSingleObject(fa.hEvent,INFINITE);
+ WaitForSingleObject(fa.hEvent, INFINITE);
CloseHandle(fa.hEvent);
return rc;
@@ -215,16 +216,16 @@ unsigned __stdcall forkthreadex_r(void * arg)
}
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
- CallService(MS_SYSTEM_THREAD_POP,0,0);
+ CallService(MS_SYSTEM_THREAD_POP, 0, 0);
return rc;
}
UINT_PTR forkthreadex(
- void *sec,
- unsigned stacksize,
- unsigned (__stdcall *threadcode)(void*),
- void* owner,
- void *arg,
+ void *sec,
+ unsigned stacksize,
+ unsigned (__stdcall *threadcode)(void*),
+ void* owner,
+ void *arg,
unsigned *thraddr )
{
UINT_PTR rc;
@@ -232,10 +233,10 @@ UINT_PTR forkthreadex(
fa.threadcodeex = threadcode;
fa.arg = arg;
fa.owner = owner;
- fa.hEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
- rc = _beginthreadex(sec,stacksize,forkthreadex_r,(void *)&fa,0,thraddr);
+ fa.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ rc = _beginthreadex(sec, stacksize, forkthreadex_r, (void *)&fa, 0, thraddr);
if (rc)
- WaitForSingleObject(fa.hEvent,INFINITE);
+ WaitForSingleObject(fa.hEvent, INFINITE);
CloseHandle(fa.hEvent);
return rc;
@@ -286,7 +287,7 @@ VOID CALLBACK KillAllThreads(HWND, UINT, UINT_PTR, DWORD)
THREAD_WAIT_ENTRY* p = threads[j];
char szModuleName[ MAX_PATH ];
GetModuleFileNameA( p->hOwner, szModuleName, sizeof(szModuleName));
- Netlib_Logf( NULL, "Thread %p was abnormally terminated because module '%s' didn't release it. Entry point: %p",
+ Netlib_Logf( NULL, "Thread %p was abnormally terminated because module '%s' didn't release it. Entry point: %p",
p->hThread, szModuleName, p->addr );
TerminateThread( p->hThread, 9999 );
CloseHandle(p->hThread);
@@ -342,7 +343,7 @@ static void UnwindThreadWait(void)
if ( MirandaWaitForMutex(hStackMutex) ) {
int j;
for ( j=0; j < threads.getCount(); j++ )
- QueueUserAPC(DummyAPCFunc,threads[j]->hThread, 0);
+ QueueUserAPC(DummyAPCFunc, threads[j]->hThread, 0);
ReleaseMutex(hStackMutex);
}
@@ -379,7 +380,7 @@ void* GetCurrentThreadEntryPoint()
return ( void* )dwStartAddress;
}
-INT_PTR UnwindThreadPush(WPARAM wParam,LPARAM lParam)
+INT_PTR UnwindThreadPush(WPARAM wParam, LPARAM lParam)
{
ResetEvent(hThreadQueueEmpty); // thread list is not empty
if (WaitForSingleObject(hStackMutex, INFINITE) == WAIT_OBJECT_0)
@@ -399,9 +400,9 @@ INT_PTR UnwindThreadPush(WPARAM wParam,LPARAM lParam)
return 0;
}
-INT_PTR UnwindThreadPop(WPARAM,LPARAM)
+INT_PTR UnwindThreadPop(WPARAM, LPARAM)
{
- if (WaitForSingleObject(hStackMutex,INFINITE) == WAIT_OBJECT_0)
+ if (WaitForSingleObject(hStackMutex, INFINITE) == WAIT_OBJECT_0)
{
DWORD dwThreadId=GetCurrentThreadId();
int j;
@@ -432,7 +433,7 @@ INT_PTR UnwindThreadPop(WPARAM,LPARAM)
INT_PTR MirandaIsTerminated(WPARAM, LPARAM)
{
- return WaitForSingleObject(hMirandaShutdown,0) == WAIT_OBJECT_0;
+ return WaitForSingleObject(hMirandaShutdown, 0) == WAIT_OBJECT_0;
}
static void __cdecl compactHeapsThread(void*)
@@ -441,20 +442,20 @@ static void __cdecl compactHeapsThread(void*)
{
HANDLE hHeaps[256];
DWORD hc;
- SleepEx((1000*60)*5,TRUE); // every 5 minutes
- hc=GetProcessHeaps(255,(PHANDLE)&hHeaps);
+ SleepEx((1000*60)*5, TRUE); // every 5 minutes
+ hc=GetProcessHeaps(255, (PHANDLE)&hHeaps);
if (hc != 0 && hc < 256) {
DWORD j;
- for (j=0;j<hc;j++) HeapCompact(hHeaps[j],0);
+ for (j=0;j<hc;j++) HeapCompact(hHeaps[j], 0);
}
} //while
}
LRESULT CALLBACK APCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- if (msg == WM_NULL) SleepEx(0,TRUE);
+ if (msg == WM_NULL) SleepEx(0, TRUE);
if (msg == WM_TIMECHANGE) RecalculateTime();
- return DefWindowProc(hwnd,msg,wParam,lParam);
+ return DefWindowProc(hwnd, msg, wParam, lParam);
}
HWND hAPCWindow=NULL;
@@ -486,7 +487,7 @@ static INT_PTR SystemGetIdle(WPARAM, LPARAM lParam)
return 0;
}
-static DWORD MsgWaitForMultipleObjectsExWorkaround(DWORD nCount, const HANDLE *pHandles,
+static DWORD MsgWaitForMultipleObjectsExWorkaround(DWORD nCount, const HANDLE *pHandles,
DWORD dwMsecs, DWORD dwWakeMask, DWORD dwFlags)
{
DWORD rc;
@@ -584,16 +585,16 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int )
#endif
hShFolder = GetModuleHandleA("shell32");
- shGetSpecialFolderPathA = (pfnSHGetSpecialFolderPathA)GetProcAddress(hShFolder,"SHGetSpecialFolderPathA");
- shGetSpecialFolderPathW = (pfnSHGetSpecialFolderPathW)GetProcAddress(hShFolder,"SHGetSpecialFolderPathW");
+ shGetSpecialFolderPathA = (pfnSHGetSpecialFolderPathA)GetProcAddress(hShFolder, "SHGetSpecialFolderPathA");
+ shGetSpecialFolderPathW = (pfnSHGetSpecialFolderPathW)GetProcAddress(hShFolder, "SHGetSpecialFolderPathW");
if (shGetSpecialFolderPathA == NULL)
{
hShFolder = LoadLibraryA("ShFolder.dll");
- shGetSpecialFolderPathA = (pfnSHGetSpecialFolderPathA)GetProcAddress(hShFolder,"SHGetSpecialFolderPathA");
- shGetSpecialFolderPathW = (pfnSHGetSpecialFolderPathW)GetProcAddress(hShFolder,"SHGetSpecialFolderPathW");
+ shGetSpecialFolderPathA = (pfnSHGetSpecialFolderPathA)GetProcAddress(hShFolder, "SHGetSpecialFolderPathA");
+ shGetSpecialFolderPathW = (pfnSHGetSpecialFolderPathW)GetProcAddress(hShFolder, "SHGetSpecialFolderPathW");
}
- shAutoComplete = (pfnSHAutoComplete)GetProcAddress(GetModuleHandleA("shlwapi"),"SHAutoComplete");
+ shAutoComplete = (pfnSHAutoComplete)GetProcAddress(GetModuleHandleA("shlwapi"), "SHAutoComplete");
if (IsWinVerXPPlus()) {
hThemeAPI = LoadLibraryA("uxtheme.dll");
@@ -604,7 +605,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int )
drawThemeBackground = (pfnDrawThemeBackground)GetProcAddress(hThemeAPI, "DrawThemeBackground");
drawThemeText = (pfnDrawThemeText)GetProcAddress(hThemeAPI, "DrawThemeText");
drawThemeTextEx = (pfnDrawThemeTextEx)GetProcAddress(hThemeAPI, "DrawThemeTextEx");
- getThemeBackgroundContentRect = (pfnGetThemeBackgroundContentRect)GetProcAddress(hThemeAPI ,"GetThemeBackgroundContentRect");
+ getThemeBackgroundContentRect = (pfnGetThemeBackgroundContentRect)GetProcAddress(hThemeAPI , "GetThemeBackgroundContentRect");
getThemeFont = (pfnGetThemeFont)GetProcAddress(hThemeAPI, "GetThemeFont");
closeThemeData = (pfnCloseThemeData)GetProcAddress(hThemeAPI, "CloseThemeData");
enableThemeDialogTexture = (pfnEnableThemeDialogTexture)GetProcAddress(hThemeAPI, "EnableThemeDialogTexture");
@@ -622,8 +623,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int )
if (IsWinVerVistaPlus()) {
hDwmApi = LoadLibraryA("dwmapi.dll");
if (hDwmApi) {
- dwmExtendFrameIntoClientArea = (pfnDwmExtendFrameIntoClientArea)GetProcAddress(hDwmApi,"DwmExtendFrameIntoClientArea");
- dwmIsCompositionEnabled = (pfnDwmIsCompositionEnabled)GetProcAddress(hDwmApi,"DwmIsCompositionEnabled");
+ dwmExtendFrameIntoClientArea = (pfnDwmExtendFrameIntoClientArea)GetProcAddress(hDwmApi, "DwmExtendFrameIntoClientArea");
+ dwmIsCompositionEnabled = (pfnDwmIsCompositionEnabled)GetProcAddress(hDwmApi, "DwmIsCompositionEnabled");
}
}
@@ -644,19 +645,19 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int )
// ParseCommandLine();
if (LoadDefaultModules()) {
- NotifyEventHooks(hShutdownEvent,0,0);
+ NotifyEventHooks(hShutdownEvent, 0, 0);
UnloadDefaultModules();
result = 1;
goto exit;
}
- NotifyEventHooks(hModulesLoadedEvent,0,0);
+ NotifyEventHooks(hModulesLoadedEvent, 0, 0);
// ensure that the kernel hooks the SystemShutdownProc() after all plugins
- HookEvent(ME_SYSTEM_SHUTDOWN,SystemShutdownProc);
+ HookEvent(ME_SYSTEM_SHUTDOWN, SystemShutdownProc);
- forkthread(compactHeapsThread,0,NULL);
- CreateServiceFunction(MS_SYSTEM_SETIDLECALLBACK,SystemSetIdleCallback);
+ forkthread(compactHeapsThread, 0, NULL);
+ CreateServiceFunction(MS_SYSTEM_SETIDLECALLBACK, SystemSetIdleCallback);
CreateServiceFunction(MS_SYSTEM_GETIDLE, SystemGetIdle);
dwEventTime=GetTickCount();
myPid=GetCurrentProcessId();
@@ -725,7 +726,7 @@ exit:
static INT_PTR OkToExit(WPARAM, LPARAM)
{
- return NotifyEventHooks(hOkToExitEvent,0,0) == 0;
+ return NotifyEventHooks(hOkToExitEvent, 0, 0) == 0;
}
static INT_PTR GetMirandaVersion(WPARAM, LPARAM)
@@ -738,11 +739,11 @@ static INT_PTR GetMirandaVersion(WPARAM, LPARAM)
VS_FIXEDFILEINFO *vsffi;
DWORD ver;
- GetModuleFileName(NULL,filename,SIZEOF(filename));
- verInfoSize=GetFileVersionInfoSize(filename,&unused);
+ GetModuleFileName(NULL, filename, SIZEOF(filename));
+ verInfoSize=GetFileVersionInfoSize(filename, &unused);
pVerInfo=mir_alloc(verInfoSize);
- GetFileVersionInfo(filename,0,verInfoSize,pVerInfo);
- VerQueryValue(pVerInfo,_T("\\"),(PVOID*)&vsffi,&blockSize);
+ GetFileVersionInfo(filename, 0, verInfoSize, pVerInfo);
+ VerQueryValue(pVerInfo, _T("\\"), (PVOID*)&vsffi, &blockSize);
ver=(((vsffi->dwProductVersionMS>>16)&0xFF)<<24)|
((vsffi->dwProductVersionMS&0xFF)<<16)|
(((vsffi->dwProductVersionLS>>16)&0xFF)<<8)|
@@ -751,7 +752,7 @@ static INT_PTR GetMirandaVersion(WPARAM, LPARAM)
return (INT_PTR)ver;
}
-static INT_PTR GetMirandaVersionText(WPARAM wParam,LPARAM lParam)
+static INT_PTR GetMirandaVersionText(WPARAM wParam, LPARAM lParam)
{
TCHAR filename[MAX_PATH], *productVersion;
DWORD unused;
@@ -759,23 +760,23 @@ static INT_PTR GetMirandaVersionText(WPARAM wParam,LPARAM lParam)
UINT blockSize;
PVOID pVerInfo;
- GetModuleFileName(NULL,filename,SIZEOF(filename));
- verInfoSize=GetFileVersionInfoSize(filename,&unused);
+ GetModuleFileName(NULL, filename, SIZEOF(filename));
+ verInfoSize=GetFileVersionInfoSize(filename, &unused);
pVerInfo=mir_alloc(verInfoSize);
- GetFileVersionInfo(filename,0,verInfoSize,pVerInfo);
- VerQueryValue(pVerInfo,_T("\\StringFileInfo\\000004b0\\ProductVersion"),(LPVOID*)&productVersion,&blockSize);
+ GetFileVersionInfo(filename, 0, verInfoSize, pVerInfo);
+ VerQueryValue(pVerInfo, _T("\\StringFileInfo\\000004b0\\ProductVersion"), (LPVOID*)&productVersion, &blockSize);
#if defined( _WIN64 )
mir_snprintf(( char* )lParam, wParam, "%S x64 Unicode", productVersion );
#elif defined( _UNICODE )
mir_snprintf(( char* )lParam, wParam, "%S Unicode", productVersion );
#else
- lstrcpyn((char*)lParam,productVersion,wParam);
+ lstrcpyn((char*)lParam, productVersion, wParam);
#endif
mir_free(pVerInfo);
return 0;
}
-INT_PTR WaitOnHandle(WPARAM wParam,LPARAM lParam)
+INT_PTR WaitOnHandle(WPARAM wParam, LPARAM lParam)
{
if (waitObjectCount>=MAXIMUM_WAIT_OBJECTS-1) return 1;
hWaitObjects[waitObjectCount]=(HANDLE)wParam;
@@ -793,8 +794,8 @@ static INT_PTR RemoveWait(WPARAM wParam, LPARAM)
break;
if (i == waitObjectCount) return 1;
waitObjectCount--;
- MoveMemory(&hWaitObjects[i],&hWaitObjects[i+1],sizeof(HANDLE)*(waitObjectCount-i));
- MoveMemory(&pszWaitServices[i],&pszWaitServices[i+1],sizeof(char*)*(waitObjectCount-i));
+ MoveMemory(&hWaitObjects[i], &hWaitObjects[i+1], sizeof(HANDLE)*(waitObjectCount-i));
+ MoveMemory(&pszWaitServices[i], &pszWaitServices[i+1], sizeof(char*)*(waitObjectCount-i));
return 0;
}
@@ -904,38 +905,38 @@ int LoadSystemModule(void)
InitCommonControlsEx(&icce);
if (IsWinVerXPPlus()) {
- hAPCWindow=CreateWindowEx(0,_T("ComboLBox"),NULL,0, 0,0,0,0, NULL,NULL,NULL,NULL);
+ hAPCWindow=CreateWindowEx(0, _T("ComboLBox"), NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
SetClassLongPtr(hAPCWindow, GCL_STYLE, GetClassLongPtr(hAPCWindow, GCL_STYLE) | CS_DROPSHADOW);
DestroyWindow(hAPCWindow);
hAPCWindow = NULL;
}
- hAPCWindow=CreateWindowEx(0,_T("STATIC"),NULL,0, 0,0,0,0, NULL,NULL,NULL,NULL); // lame
- SetWindowLongPtr(hAPCWindow,GWLP_WNDPROC,(LONG_PTR)APCWndProc);
- hStackMutex=CreateMutex(NULL,FALSE,NULL);
- hMirandaShutdown=CreateEvent(NULL,TRUE,FALSE,NULL);
- hThreadQueueEmpty=CreateEvent(NULL,TRUE,TRUE,NULL);
+ hAPCWindow=CreateWindowEx(0, _T("STATIC"), NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); // lame
+ SetWindowLongPtr(hAPCWindow, GWLP_WNDPROC, (LONG_PTR)APCWndProc);
+ hStackMutex=CreateMutex(NULL, FALSE, NULL);
+ hMirandaShutdown=CreateEvent(NULL, TRUE, FALSE, NULL);
+ hThreadQueueEmpty=CreateEvent(NULL, TRUE, TRUE, NULL);
hShutdownEvent=CreateHookableEvent(ME_SYSTEM_SHUTDOWN);
hPreShutdownEvent=CreateHookableEvent(ME_SYSTEM_PRESHUTDOWN);
hModulesLoadedEvent=CreateHookableEvent(ME_SYSTEM_MODULESLOADED);
hOkToExitEvent=CreateHookableEvent(ME_SYSTEM_OKTOEXIT);
- CreateServiceFunction(MS_SYSTEM_FORK_THREAD,ForkThreadService);
- CreateServiceFunction(MS_SYSTEM_FORK_THREAD_EX,ForkThreadServiceEx);
- CreateServiceFunction(MS_SYSTEM_THREAD_PUSH,UnwindThreadPush);
- CreateServiceFunction(MS_SYSTEM_THREAD_POP,UnwindThreadPop);
- CreateServiceFunction(MS_SYSTEM_TERMINATED,MirandaIsTerminated);
- CreateServiceFunction(MS_SYSTEM_OKTOEXIT,OkToExit);
- CreateServiceFunction(MS_SYSTEM_GETVERSION,GetMirandaVersion);
- CreateServiceFunction(MS_SYSTEM_GETVERSIONTEXT,GetMirandaVersionText);
- CreateServiceFunction(MS_SYSTEM_WAITONHANDLE,WaitOnHandle);
- CreateServiceFunction(MS_SYSTEM_REMOVEWAIT,RemoveWait);
- CreateServiceFunction(MS_SYSTEM_GET_LI,GetListInterface);
- CreateServiceFunction(MS_SYSTEM_GET_MMI,GetMemoryManagerInterface);
- CreateServiceFunction(MS_SYSTEM_GET_UTFI,GetUtfInterface);
- CreateServiceFunction(MS_SYSTEM_GETEXCEPTFILTER,GetExceptionFilter);
- CreateServiceFunction(MS_SYSTEM_SETEXCEPTFILTER,SetExceptionFilter);
+ CreateServiceFunction(MS_SYSTEM_FORK_THREAD, ForkThreadService);
+ CreateServiceFunction(MS_SYSTEM_FORK_THREAD_EX, ForkThreadServiceEx);
+ CreateServiceFunction(MS_SYSTEM_THREAD_PUSH, UnwindThreadPush);
+ CreateServiceFunction(MS_SYSTEM_THREAD_POP, UnwindThreadPop);
+ CreateServiceFunction(MS_SYSTEM_TERMINATED, MirandaIsTerminated);
+ CreateServiceFunction(MS_SYSTEM_OKTOEXIT, OkToExit);
+ CreateServiceFunction(MS_SYSTEM_GETVERSION, GetMirandaVersion);
+ CreateServiceFunction(MS_SYSTEM_GETVERSIONTEXT, GetMirandaVersionText);
+ CreateServiceFunction(MS_SYSTEM_WAITONHANDLE, WaitOnHandle);
+ CreateServiceFunction(MS_SYSTEM_REMOVEWAIT, RemoveWait);
+ CreateServiceFunction(MS_SYSTEM_GET_LI, GetListInterface);
+ CreateServiceFunction(MS_SYSTEM_GET_MMI, GetMemoryManagerInterface);
+ CreateServiceFunction(MS_SYSTEM_GET_UTFI, GetUtfInterface);
+ CreateServiceFunction(MS_SYSTEM_GETEXCEPTFILTER, GetExceptionFilter);
+ CreateServiceFunction(MS_SYSTEM_SETEXCEPTFILTER, SetExceptionFilter);
InitPathUtils();
return 0;
diff --git a/src/core/miranda.h b/src/core/miranda.h
index 3596dd3e13..f9d6340fb4 100644
--- a/src/core/miranda.h
+++ b/src/core/miranda.h
@@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -21,8 +21,8 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#define NEWSTR_ALLOCA(A) (A == NULL)?NULL:strcpy((char*)alloca(strlen(A)+1),A)
-#define NEWTSTR_ALLOCA(A) (A == NULL)?NULL:_tcscpy((TCHAR*)alloca((_tcslen(A)+1)* sizeof(TCHAR)),A)
+#define NEWSTR_ALLOCA(A) (A == NULL)?NULL:strcpy((char*)alloca(strlen(A)+1), A)
+#define NEWTSTR_ALLOCA(A) (A == NULL)?NULL:_tcscpy((TCHAR*)alloca((_tcslen(A)+1)* sizeof(TCHAR)), A)
typedef HMONITOR (WINAPI *pfnMyMonitorFromPoint)(POINT, DWORD);
extern pfnMyMonitorFromPoint MyMonitorFromPoint;
@@ -36,7 +36,7 @@ extern pfnMyMonitorFromWindow MyMonitorFromWindow;
typedef BOOL(WINAPI *pfnMyGetMonitorInfo) (HMONITOR, LPMONITORINFO);
extern pfnMyGetMonitorInfo MyGetMonitorInfo;
-typedef HRESULT (STDAPICALLTYPE *pfnSHAutoComplete)(HWND,DWORD);
+typedef HRESULT (STDAPICALLTYPE *pfnSHAutoComplete)(HWND, DWORD);
extern pfnSHAutoComplete shAutoComplete;
typedef HRESULT (STDAPICALLTYPE *pfnSHGetSpecialFolderPathA)(HWND, LPSTR, int, BOOL );
@@ -142,7 +142,7 @@ char* mir_u2a( const wchar_t* src);
/**** miranda.c ************************************************************************/
extern HINSTANCE hMirandaInst;
-extern HANDLE hOkToExitEvent,hModulesLoadedEvent;
+extern HANDLE hOkToExitEvent, hModulesLoadedEvent;
extern pfnExceptionFilter pMirandaExceptFilter;
/**** modules.c ************************************************************************/
diff --git a/src/core/modules.cpp b/src/core/modules.cpp
index a24d554a29..43ac51ce78 100644
--- a/src/core/modules.cpp
+++ b/src/core/modules.cpp
@@ -2,7 +2,7 @@
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -73,7 +73,7 @@ typedef struct
// other static variables
static BOOL bServiceMode = FALSE;
-static CRITICAL_SECTION csHooks,csServices;
+static CRITICAL_SECTION csHooks, csServices;
static DWORD mainThreadId;
static int hookId = 1;
static HANDLE hMainThread;
@@ -176,7 +176,7 @@ int LoadDefaultModules(void)
}
//this info will be available at LoadNewPluginsModule()
- INT_PTR *disableDefaultModule=(INT_PTR*)CallService(MS_PLUGINS_GETDISABLEDEFAULTARRAY,0,0);
+ INT_PTR *disableDefaultModule=(INT_PTR*)CallService(MS_PLUGINS_GETDISABLEDEFAULTARRAY, 0, 0);
if (LoadSkinSounds()) return 1;
if (LoadSkinHotkeys()) return 1;
@@ -245,7 +245,7 @@ int InitialiseModularEngine(void)
InitializeCriticalSection(&csServices);
mainThreadId=GetCurrentThreadId();
- DuplicateHandle(GetCurrentProcess(),GetCurrentThread(),GetCurrentProcess(),&hMainThread,0,FALSE,DUPLICATE_SAME_ACCESS);
+ DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, 0, FALSE, DUPLICATE_SAME_ACCESS);
hMissingService = CreateHookableEvent(ME_SYSTEM_MISSINGSERVICE);
return 0;
@@ -443,7 +443,7 @@ int NotifyEventHooks( HANDLE hEvent, WPARAM wParam, LPARAM lParam )
if ( GetCurrentThreadId() != mainThreadId ) {
THookToMainThreadItem item;
- item.hDoneEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
+ item.hDoneEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
item.hook = ( THook* )hEvent;
item.wParam = wParam;
item.lParam = lParam;
@@ -518,7 +518,7 @@ HANDLE HookEventMessage( const char* name, HWND hwnd, UINT message )
EnterCriticalSection( &csHooks );
if (( idx = hooks.getIndex(( THook* )name )) == -1 ) {
#ifdef _DEBUG
- MessageBoxA(NULL,"Attempt to hook non-existant event",name,MB_OK);
+ MessageBoxA(NULL, "Attempt to hook non-existant event", name, MB_OK);
#endif
LeaveCriticalSection(&csHooks);
return NULL;
@@ -589,7 +589,7 @@ void KillModuleEventHooks( HINSTANCE hInst )
if ( hooks[i]->subscriber[j].hOwner == hInst ) {
char szModuleName[ MAX_PATH ];
GetModuleFileNameA( hooks[i]->subscriber[j].hOwner, szModuleName, sizeof(szModuleName));
- Netlib_Logf( NULL, "A hook %08x for event '%s' was abnormally deleted because module '%s' didn't released it",
+ Netlib_Logf( NULL, "A hook %08x for event '%s' was abnormally deleted because module '%s' didn't released it",
hooks[i]->subscriber[j].pfnHook, hooks[i]->name, szModuleName );
UnhookEvent(( HANDLE )(( hooks[i]->id << 16 ) + j + 1 ));
if ( hooks[i]->subscriberCount == 0 )
@@ -660,17 +660,17 @@ HANDLE CreateServiceFunction( const char *name, MIRANDASERVICE serviceProc )
return CreateServiceInt( 0, name, serviceProc, 0, 0 );
}
-HANDLE CreateServiceFunctionParam(const char *name,MIRANDASERVICEPARAM serviceProc,LPARAM lParam)
+HANDLE CreateServiceFunctionParam(const char *name, MIRANDASERVICEPARAM serviceProc, LPARAM lParam)
{
return CreateServiceInt( 1, name, (MIRANDASERVICE)serviceProc, 0, lParam );
}
-HANDLE CreateServiceFunctionObj(const char *name,MIRANDASERVICEOBJ serviceProc,void* object)
+HANDLE CreateServiceFunctionObj(const char *name, MIRANDASERVICEOBJ serviceProc, void* object)
{
return CreateServiceInt( 2, name, (MIRANDASERVICE)serviceProc, object, 0 );
}
-HANDLE CreateServiceFunctionObjParam(const char *name,MIRANDASERVICEOBJPARAM serviceProc,void* object,LPARAM lParam)
+HANDLE CreateServiceFunctionObjParam(const char *name, MIRANDASERVICEOBJPARAM serviceProc, void* object, LPARAM lParam)
{
return CreateServiceInt( 3, name, (MIRANDASERVICE)serviceProc, object, lParam );
}
@@ -700,11 +700,11 @@ int ServiceExists(const char *name)
return ret;
}
-INT_PTR CallService(const char *name,WPARAM wParam,LPARAM lParam)
+INT_PTR CallService(const char *name, WPARAM wParam, LPARAM lParam)
{
#ifdef _DEBUG
if (name == NULL) {
- MessageBoxA(0,"Someone tried to CallService(NULL,..) see stack trace for details","",0);
+ MessageBoxA(0, "Someone tried to CallService(NULL, ..) see stack trace for details", "", 0);
DebugBreak();
return CALLSERVICE_NOTFOUND;
}
@@ -717,13 +717,13 @@ INT_PTR CallService(const char *name,WPARAM wParam,LPARAM lParam)
if (pService == NULL) {
LeaveCriticalSection(&csServices);
#ifdef _DEBUG
- //MessageBoxA(NULL,"Attempt to call non-existant service",name,MB_OK);
+ //MessageBoxA(NULL, "Attempt to call non-existant service", name, MB_OK);
OutputDebugStringA("Missing service called: \t");
OutputDebugStringA(name);
OutputDebugStringA("\n");
#endif
/* { MISSING_SERVICE_PARAMS params = { name, wParam, lParam };
- int result = NotifyEventHooks(hMissingService,0,(LPARAM)&params);
+ int result = NotifyEventHooks(hMissingService, 0, (LPARAM)&params);
if (result != 0)
return params.lParam;
} */
@@ -736,10 +736,10 @@ INT_PTR CallService(const char *name,WPARAM wParam,LPARAM lParam)
void* object = pService->object;
LeaveCriticalSection(&csServices);
switch( flags ) {
- case 1: return ((MIRANDASERVICEPARAM)pfnService)(wParam,lParam,fnParam);
- case 2: return ((MIRANDASERVICEOBJ)pfnService)(object,wParam,lParam);
- case 3: return ((MIRANDASERVICEOBJPARAM)pfnService)(object,wParam,lParam,fnParam);
- default: return pfnService(wParam,lParam);
+ case 1: return ((MIRANDASERVICEPARAM)pfnService)(wParam, lParam, fnParam);
+ case 2: return ((MIRANDASERVICEOBJ)pfnService)(object, wParam, lParam);
+ case 3: return ((MIRANDASERVICEOBJPARAM)pfnService)(object, wParam, lParam, fnParam);
+ default: return pfnService(wParam, lParam);
} }
static void CALLBACK CallServiceToMainAPCFunc(ULONG_PTR dwParam)
@@ -764,7 +764,7 @@ INT_PTR CallServiceSync(const char *name, WPARAM wParam, LPARAM lParam)
item.name = name;
item.hDoneEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
QueueUserAPC(CallServiceToMainAPCFunc, hMainThread, (ULONG_PTR) &item);
- PostMessage(hAPCWindow,WM_NULL,0,0); // let this get processed in its own time
+ PostMessage(hAPCWindow, WM_NULL, 0, 0); // let this get processed in its own time
WaitForSingleObject(item.hDoneEvent, INFINITE);
CloseHandle(item.hDoneEvent);
return item.result;
@@ -777,7 +777,7 @@ int CallFunctionAsync( void (__stdcall *func)(void *), void *arg)
{
extern HWND hAPCWindow;
int r = QueueUserAPC(( void (__stdcall *)( ULONG_PTR ))func, hMainThread, ( ULONG_PTR )arg );
- PostMessage(hAPCWindow,WM_NULL,0,0);
+ PostMessage(hAPCWindow, WM_NULL, 0, 0);
return r;
}
@@ -790,7 +790,7 @@ void KillModuleServices( HINSTANCE hInst )
if ( services[i]->hOwner == hInst ) {
char szModuleName[ MAX_PATH ];
GetModuleFileNameA( services[i]->hOwner, szModuleName, sizeof(szModuleName));
- Netlib_Logf( NULL, "A service function '%s' was abnormally deleted because module '%s' didn't released it",
+ Netlib_Logf( NULL, "A service function '%s' was abnormally deleted because module '%s' didn't released it",
services[i]->name, szModuleName );
DestroyServiceFunction(( HANDLE )services[i]->nameHash );
} }
diff --git a/src/core/modules.h b/src/core/modules.h
index f40fc885e6..dc993a97b1 100644
--- a/src/core/modules.h
+++ b/src/core/modules.h
@@ -2,7 +2,7 @@
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -34,15 +34,15 @@ restructuring modules.c for performance.
*/
#define MAXMODULELABELLENGTH 64
-typedef int (*MIRANDAHOOK)(WPARAM,LPARAM);
-typedef int (*MIRANDAHOOKPARAM)(WPARAM,LPARAM,LPARAM);
-typedef int (*MIRANDAHOOKOBJ)(void*,WPARAM,LPARAM);
-typedef int (*MIRANDAHOOKOBJPARAM)(void*,WPARAM,LPARAM,LPARAM);
+typedef int (*MIRANDAHOOK)(WPARAM, LPARAM);
+typedef int (*MIRANDAHOOKPARAM)(WPARAM, LPARAM, LPARAM);
+typedef int (*MIRANDAHOOKOBJ)(void*, WPARAM, LPARAM);
+typedef int (*MIRANDAHOOKOBJPARAM)(void*, WPARAM, LPARAM, LPARAM);
-typedef INT_PTR (*MIRANDASERVICE)(WPARAM,LPARAM);
-typedef INT_PTR (*MIRANDASERVICEPARAM)(WPARAM,LPARAM,LPARAM);
-typedef INT_PTR (*MIRANDASERVICEOBJ)(void*,LPARAM,LPARAM);
-typedef INT_PTR (*MIRANDASERVICEOBJPARAM)(void*,WPARAM,LPARAM,LPARAM);
+typedef INT_PTR (*MIRANDASERVICE)(WPARAM, LPARAM);
+typedef INT_PTR (*MIRANDASERVICEPARAM)(WPARAM, LPARAM, LPARAM);
+typedef INT_PTR (*MIRANDASERVICEOBJ)(void*, LPARAM, LPARAM);
+typedef INT_PTR (*MIRANDASERVICEOBJPARAM)(void*, WPARAM, LPARAM, LPARAM);
typedef struct
{
@@ -116,7 +116,7 @@ considerably slower than from the main thread, but will consume only slightly
more actual CPU time, the rest will mostly be spent waiting for the main thread
to return to the message loop so it can be interrupted neatly.
*/
-int NotifyEventHooks(HANDLE hEvent,WPARAM wParam,LPARAM lParam);
+int NotifyEventHooks(HANDLE hEvent, WPARAM wParam, LPARAM lParam);
/* CallHookSubscribers
Works precisely like NotifyEventHooks, but without switching to the first thread
@@ -144,7 +144,7 @@ referring to the hook otherwise. Note that debug builds will warn with a
MessageBoxA if a hook is attempted on an unknown event. All hooks will be
automatically destroyed when their parent event is destroyed or the programme
ends, but can be unhooked earlier using UnhookEvent(). hookProc() is defined as
- int HookProc(WPARAM wParam,LPARAM lParam)
+ int HookProc(WPARAM wParam, LPARAM lParam)
where you can substitute your own name for HookProc. wParam and lParam are
defined by the creator of the event when NotifyEventHooks() is called.
The return value is 0 to continue processing the other hooks, or nonzero
@@ -152,9 +152,9 @@ to stop immediately. This abort value is returned to the caller of
NotifyEventHooks() and should not be -1 since that is a special return code
for NotifyEventHooks() (see above)
*/
-HANDLE HookEvent(const char *name,MIRANDAHOOK hookProc);
+HANDLE HookEvent(const char *name, MIRANDAHOOK hookProc);
HANDLE HookEventParam(const char *name, MIRANDAHOOKPARAM hookProc, LPARAM lParam);
-HANDLE HookEventObj(const char *name,MIRANDAHOOKOBJ hookProc, void* object);
+HANDLE HookEventObj(const char *name, MIRANDAHOOKOBJ hookProc, void* object);
HANDLE HookEventObjParam(const char *name, MIRANDAHOOKOBJPARAM hookProc, void* object, LPARAM lParam);
/* HookEventMessage
@@ -167,7 +167,7 @@ The window procedure is called with the message 'message' and the wParam and
lParam given to NotifyEventHooks(). The return value of SendMessage() is used
in the same way as the return value in HookEvent().
*/
-HANDLE HookEventMessage(const char *name,HWND hwnd,UINT message);
+HANDLE HookEventMessage(const char *name, HWND hwnd, UINT message);
/* UnhookEvent
Removes a hook from its event chain. It will no longer receive any events.
@@ -185,37 +185,37 @@ on exit, but can be removed from the list earlier using
DestroyServiceFunction()
Returns NULL if name has already been used. serviceProc is defined by the
caller as
- int ServiceProc(WPARAM wParam,LPARAM lParam)
+ int ServiceProc(WPARAM wParam, LPARAM lParam)
where the creator publishes the meanings of wParam, lParam and the return value
Service functions must not return CALLSERVICE_NOTFOUND since that would confuse
callers of CallService().
*/
-HANDLE CreateServiceFunction(const char *name,MIRANDASERVICE serviceProc);
+HANDLE CreateServiceFunction(const char *name, MIRANDASERVICE serviceProc);
/* CreateServiceFunctionParam
Same as CreateServiceFunction - adds new parameter, to pass to service handler function.
serviceProc is defined by the caller as
- int ServiceProc(WPARAM wParam,LPARAM lParam,LPARAM fnParam)
+ int ServiceProc(WPARAM wParam, LPARAM lParam, LPARAM fnParam)
where fnParam does not need to be publicly known. Gives the ability to handle multiple services
with the same function.
added during 0.7+ (2007/04/24)
*/
-HANDLE CreateServiceFunctionParam(const char *name,MIRANDASERVICEPARAM serviceProc,LPARAM lParam);
+HANDLE CreateServiceFunctionParam(const char *name, MIRANDASERVICEPARAM serviceProc, LPARAM lParam);
/* CreateServiceFunctionObj
CreateServiceFunctionObjParam
Same as CreateServiceFunction - adds new parameter, an object, to pass to service handler function.
serviceProc is defined by the caller as
- int ServiceProc(void* object, WPARAM wParam,LPARAM lParam[,LPARAM fnParam])
+ int ServiceProc(void* object, WPARAM wParam, LPARAM lParam[, LPARAM fnParam])
where fnParam does not need to be publicly known. Gives the ability to handle multiple services
with the same function.
added during 0.7+ (2007/04/24)
*/
-HANDLE CreateServiceFunctionObj(const char *name,MIRANDASERVICEOBJ serviceProc,void* object);
-HANDLE CreateServiceFunctionObjParam(const char *name,MIRANDASERVICEOBJPARAM serviceProc,void* object,LPARAM lParam);
+HANDLE CreateServiceFunctionObj(const char *name, MIRANDASERVICEOBJ serviceProc, void* object);
+HANDLE CreateServiceFunctionObjParam(const char *name, MIRANDASERVICEOBJPARAM serviceProc, void* object, LPARAM lParam);
/* DestroyServiceFunction
Removes the function associated with hService from the global service function
@@ -236,7 +236,7 @@ created, or the value the service function returned otherwise.
#else
#define CALLSERVICE_NOTFOUND ((int)0x80000000)
#endif
-INT_PTR CallService(const char *name,WPARAM wParam,LPARAM lParam);
+INT_PTR CallService(const char *name, WPARAM wParam, LPARAM lParam);
/* ServiceExists
Finds if a service with the given name exists