summaryrefslogtreecommitdiff
path: root/src/mir_core/protos.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir_core/protos.cpp')
-rw-r--r--src/mir_core/protos.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mir_core/protos.cpp b/src/mir_core/protos.cpp
index ce752450b5..b8cacdd8fb 100644
--- a/src/mir_core/protos.cpp
+++ b/src/mir_core/protos.cpp
@@ -85,8 +85,8 @@ MIR_CORE_DLL(INT_PTR) ProtoCallService(const char *szModule, const char *szServi
return false;
char str[MAXMODULELABELLENGTH * 2];
- strncpy_s(str,szModule,strlen(szModule));
- strncat_s(str,szService,strlen(szService));
+ strncpy_s(str, szModule, _TRUNCATE);
+ strncat_s(str, szService, _TRUNCATE);
return CallService(str, wParam, lParam);
}
@@ -98,8 +98,8 @@ MIR_CORE_DLL(int) ProtoServiceExists(const char *szModule, const char *szService
return false;
char str[MAXMODULELABELLENGTH * 2];
- strncpy_s(str, szModule, strlen(szModule));
- strncat_s(str, szService, strlen(szService));
+ strncpy_s(str, szModule, _TRUNCATE);
+ strncat_s(str, szService, _TRUNCATE);
return ServiceExists(str);
}
@@ -123,16 +123,16 @@ MIR_CORE_DLL(void) ProtoDestructor(PROTO_INTERFACE *pThis)
MIR_CORE_DLL(void) ProtoCreateService(PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFunc serviceProc)
{
char str[MAXMODULELABELLENGTH * 2];
- strncpy_s(str, pThis->m_szModuleName, strlen(pThis->m_szModuleName));
- strncat_s(str, szService, strlen(szService));
+ strncpy_s(str, pThis->m_szModuleName, _TRUNCATE);
+ strncat_s(str, szService, _TRUNCATE);
::CreateServiceFunctionObj(str, (MIRANDASERVICEOBJ)*(void**)&serviceProc, pThis);
}
MIR_CORE_DLL(void) ProtoCreateServiceParam(PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFuncParam serviceProc, LPARAM lParam)
{
char str[MAXMODULELABELLENGTH * 2];
- strncpy_s(str, pThis->m_szModuleName, strlen(pThis->m_szModuleName));
- strncat_s(str, szService, strlen(szService));
+ strncpy_s(str, pThis->m_szModuleName, _TRUNCATE);
+ strncat_s(str, szService, _TRUNCATE);
::CreateServiceFunctionObjParam(str, (MIRANDASERVICEOBJPARAM)*(void**)&serviceProc, pThis, lParam);
}
@@ -144,21 +144,21 @@ MIR_CORE_DLL(void) ProtoHookEvent(PROTO_INTERFACE *pThis, const char* szEvent, P
MIR_CORE_DLL(HANDLE) ProtoCreateHookableEvent(PROTO_INTERFACE *pThis, const char* szName)
{
char str[MAXMODULELABELLENGTH * 2];
- strncpy_s(str, pThis->m_szModuleName, strlen(pThis->m_szModuleName));
- strncat_s(str, szName, strlen(szName));
+ strncpy_s(str, pThis->m_szModuleName, _TRUNCATE);
+ strncat_s(str, szName, _TRUNCATE);
return CreateHookableEvent(str);
}
MIR_CORE_DLL(void) ProtoForkThread(PROTO_INTERFACE *pThis, ProtoThreadFunc pFunc, void *param)
{
UINT threadID;
- CloseHandle((HANDLE)::mir_forkthreadowner((pThreadFuncOwner) *(void**)&pFunc, pThis, param, &threadID));
+ CloseHandle((HANDLE)::mir_forkthreadowner((pThreadFuncOwner)*(void**)&pFunc, pThis, param, &threadID));
}
MIR_CORE_DLL(HANDLE) ProtoForkThreadEx(PROTO_INTERFACE *pThis, ProtoThreadFunc pFunc, void *param, UINT* threadID)
{
UINT lthreadID;
- return (HANDLE)::mir_forkthreadowner((pThreadFuncOwner) *(void**)&pFunc, pThis, param, threadID ? threadID : &lthreadID);
+ return (HANDLE)::mir_forkthreadowner((pThreadFuncOwner)*(void**)&pFunc, pThis, param, threadID ? threadID : &lthreadID);
}
/////////////////////////////////////////////////////////////////////////////////////////