summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_runtime.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-08-07 16:00:02 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-08-07 16:00:02 +0000
commita1f4c0621436e68af9c12a63df0b6449b0f96e22 (patch)
treef1b0350e70b918b9a25452aa1288cb60e2f7c17a /protocols/Skype/src/skype_runtime.cpp
parent940b761b023eba93d9d605e75a3216ba5d023dad (diff)
resource update
git-svn-id: http://svn.miranda-ng.org/main/trunk@5612 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_runtime.cpp')
-rw-r--r--protocols/Skype/src/skype_runtime.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/protocols/Skype/src/skype_runtime.cpp b/protocols/Skype/src/skype_runtime.cpp
index bd6fe46a49..793d96f5f3 100644
--- a/protocols/Skype/src/skype_runtime.cpp
+++ b/protocols/Skype/src/skype_runtime.cpp
@@ -23,8 +23,8 @@ char *CSkypeProto::LoadKeyPair()
return NULL;
char* pData = (char*)_alloca(length + 1);
- ::memcpy(pData, pLockedResource, length);
- pData[length] = 0;
+ ::memcpy(pData, pLockedResource, length);
+ pData[length] = 0;
unsigned decodedLen;
mir_ptr<BYTE> tmpD((BYTE*)::mir_base64_decode(pData, &decodedLen));
@@ -55,7 +55,7 @@ int CSkypeProto::StartSkypeRuntime(const wchar_t *profileName)
wchar_t *skypeKitPath = ::wcsrchr(fileName, '\\');
if (skypeKitPath != NULL)
*skypeKitPath = 0;
- ::swprintf(fileName, SIZEOF(fileName), L"%s\\%s", fileName, L"SkypeKit.exe");
+ ::mir_snwprintf(fileName, SIZEOF(fileName), L"%s\\%s", fileName, L"SkypeKit.exe");
PROCESSENTRY32 entry;
entry.dwSize = sizeof(PROCESSENTRY32);
@@ -77,7 +77,7 @@ int CSkypeProto::StartSkypeRuntime(const wchar_t *profileName)
wchar_t param[128];
VARST dbPath( _T("%miranda_userdata%\\SkypeKit"));
- ::swprintf(param, SIZEOF(param), L"-p -P %d -f \"%s\"", this->skypeKitPort, dbPath);
+ ::mir_snwprintf(param, SIZEOF(param), L"-p -P %d -f \"%s\"", this->skypeKitPort, dbPath);
int startingrt = ::CreateProcess(
fileName, param,
NULL, NULL, FALSE,
@@ -89,59 +89,59 @@ int CSkypeProto::StartSkypeRuntime(const wchar_t *profileName)
BOOL CSkypeProto::SafeTerminateProcess(HANDLE hProcess, UINT uExitCode)
{
- DWORD dwTID, dwCode, dwErr = 0;
- HANDLE hProcessDup = INVALID_HANDLE_VALUE;
- HANDLE hRT = NULL;
- HINSTANCE hKernel = ::GetModuleHandle(L"Kernel32");
- BOOL bSuccess = FALSE;
-
- BOOL bDup = ::DuplicateHandle(
- ::GetCurrentProcess(),
- hProcess,
- GetCurrentProcess(),
- &hProcessDup,
- PROCESS_ALL_ACCESS,
+ DWORD dwTID, dwCode, dwErr = 0;
+ HANDLE hProcessDup = INVALID_HANDLE_VALUE;
+ HANDLE hRT = NULL;
+ HINSTANCE hKernel = ::GetModuleHandle(L"Kernel32");
+ BOOL bSuccess = FALSE;
+
+ BOOL bDup = ::DuplicateHandle(
+ ::GetCurrentProcess(),
+ hProcess,
+ GetCurrentProcess(),
+ &hProcessDup,
+ PROCESS_ALL_ACCESS,
FALSE,
0);
- // Detect the special case where the process is
- // already dead...
- if (::GetExitCodeProcess((bDup) ? hProcessDup : hProcess, &dwCode) && (dwCode == STILL_ACTIVE))
- {
- FARPROC pfnExitProc;
-
- pfnExitProc = GetProcAddress(hKernel, "ExitProcess");
+ // Detect the special case where the process is
+ // already dead...
+ if (::GetExitCodeProcess((bDup) ? hProcessDup : hProcess, &dwCode) && (dwCode == STILL_ACTIVE))
+ {
+ FARPROC pfnExitProc;
+
+ pfnExitProc = GetProcAddress(hKernel, "ExitProcess");
- hRT = ::CreateRemoteThread(
+ hRT = ::CreateRemoteThread(
(bDup) ? hProcessDup : hProcess,
NULL,
0,
(LPTHREAD_START_ROUTINE)pfnExitProc,
(PVOID)uExitCode, 0, &dwTID);
- if ( hRT == NULL )
- dwErr = GetLastError();
- }
- else
- dwErr = ERROR_PROCESS_ABORTED;
+ if ( hRT == NULL )
+ dwErr = GetLastError();
+ }
+ else
+ dwErr = ERROR_PROCESS_ABORTED;
- if (hRT)
- {
- // Must wait process to terminate to
- // guarantee that it has exited...
- ::WaitForSingleObject((bDup) ? hProcessDup : hProcess, INFINITE);
+ if (hRT)
+ {
+ // Must wait process to terminate to
+ // guarantee that it has exited...
+ ::WaitForSingleObject((bDup) ? hProcessDup : hProcess, INFINITE);
- ::CloseHandle(hRT);
- bSuccess = TRUE;
- }
+ ::CloseHandle(hRT);
+ bSuccess = TRUE;
+ }
- if ( bDup )
- ::CloseHandle(hProcessDup);
+ if ( bDup )
+ ::CloseHandle(hProcessDup);
- if ( !bSuccess )
- ::SetLastError(dwErr);
+ if ( !bSuccess )
+ ::SetLastError(dwErr);
- return bSuccess;
+ return bSuccess;
}
void CSkypeProto::StopSkypeRuntime()