diff options
-rw-r--r-- | plugins/MirOTR/MirOTR/dialogs.cpp | 7 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/options.cpp | 7 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/otr.cpp | 7 | ||||
-rw-r--r-- | plugins/MirOTR/libgcrypt-1.4.6/cipher/md.c | 6 | ||||
-rw-r--r-- | plugins/MirOTR/libgcrypt-1.4.6/cipher/pubkey.c | 8 | ||||
-rw-r--r-- | plugins/MirOTR/libgcrypt-1.4.6/random/random-csprng.c | 32 | ||||
-rw-r--r-- | plugins/MirOTR/libgcrypt-1.4.6/random/rndw32.c | 24 | ||||
-rw-r--r-- | plugins/MirOTR/libgcrypt-1.4.6/src/ath.c | 4 | ||||
-rw-r--r-- | plugins/MirOTR/libgcrypt-1.4.6/src/fips.c | 4 | ||||
-rw-r--r-- | plugins/MirOTR/libgcrypt-1.4.6/src/gcrypt.h | 1 | ||||
-rw-r--r-- | plugins/Popup/src/popup_thread.cpp | 4 | ||||
-rw-r--r-- | plugins/Popup/src/popup_wnd2.cpp | 4 | ||||
-rw-r--r-- | plugins/SeenPlugin/utils.cpp | 25 |
13 files changed, 61 insertions, 72 deletions
diff --git a/plugins/MirOTR/MirOTR/dialogs.cpp b/plugins/MirOTR/MirOTR/dialogs.cpp index 4415aa09cf..3335935282 100644 --- a/plugins/MirOTR/MirOTR/dialogs.cpp +++ b/plugins/MirOTR/MirOTR/dialogs.cpp @@ -719,8 +719,9 @@ INT_PTR CALLBACK DlgProcVerifyContext(HWND hwndDlg, UINT msg, WPARAM wParam, LPA return FALSE;
}
-unsigned int CALLBACK verify_context_thread(void *param) {
- CallService(MS_SYSTEM_THREAD_PUSH, 0, 0);
+unsigned int CALLBACK verify_context_thread(void *param)
+{
+ Thread_Push( 0 );
if (param) {
ConnContext *context = (ConnContext *)param;
@@ -750,6 +751,6 @@ unsigned int CALLBACK verify_context_thread(void *param) { }
}
- CallService(MS_SYSTEM_THREAD_POP, 0, 0);
+ Thread_Pop();
return 0;
}
\ No newline at end of file diff --git a/plugins/MirOTR/MirOTR/options.cpp b/plugins/MirOTR/MirOTR/options.cpp index dd2ab9a76b..1e4a98f288 100644 --- a/plugins/MirOTR/MirOTR/options.cpp +++ b/plugins/MirOTR/MirOTR/options.cpp @@ -299,8 +299,9 @@ static INT_PTR CALLBACK DlgProcMirOTROpts(HWND hwndDlg, UINT msg, WPARAM wParam, return FALSE;
}
-static unsigned int CALLBACK regen_key_thread(void* param) {
- CallService(MS_SYSTEM_THREAD_PUSH, 0, 0);
+static unsigned int CALLBACK regen_key_thread(void* param)
+{
+ Thread_Push(0);
PROTOREGENKEYOPTIONS *opts = (PROTOREGENKEYOPTIONS *)param;
TCHAR *buff = (TCHAR*) mir_alloc(512*sizeof(TCHAR));
mir_sntprintf(buff, 512, TranslateT(LANG_OTR_ASK_NEWKEY), opts->proto);
@@ -326,7 +327,7 @@ static unsigned int CALLBACK regen_key_thread(void* param) { }
EnableWindow(opts->refresh, TRUE);
delete opts;
- CallService(MS_SYSTEM_THREAD_POP, 0, 0);
+ Thread_Pop();
return 0;
}
diff --git a/plugins/MirOTR/MirOTR/otr.cpp b/plugins/MirOTR/MirOTR/otr.cpp index 380bc891c3..69c8efebe0 100644 --- a/plugins/MirOTR/MirOTR/otr.cpp +++ b/plugins/MirOTR/MirOTR/otr.cpp @@ -31,15 +31,16 @@ struct GenKeyData{ const char *proto;
};
-static unsigned int CALLBACK generate_key_thread(void* param) {
- CallService(MS_SYSTEM_THREAD_PUSH, 0, 0);
+static unsigned int CALLBACK generate_key_thread(void* param)
+{
+ Thread_Push(0);
GenKeyData *data = (GenKeyData *)param;
//lib_cs_lock();
otrl_privkey_generate(otr_user_state, g_private_key_filename, data->proto, data->proto);
//lib_cs_unlock();
PostMessage(data->dialog, WMU_ENDDIALOG, 0, 0);
mir_free(data);
- CallService(MS_SYSTEM_THREAD_POP, 0, 0);
+ Thread_Pop();
return 0;
}
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/md.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/md.c index 84c7799d61..da07783d92 100644 --- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/md.c +++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/md.c @@ -207,7 +207,7 @@ gcry_md_lookup_func_name (void *spec, void *data) gcry_md_spec_t *digest = (gcry_md_spec_t *) spec; char *name = (char *) data; - return (! stricmp (digest->name, name)); + return (!_stricmp (digest->name, name)); } /* Internal callback function. Used via _gcry_module_lookup. */ @@ -222,7 +222,7 @@ gcry_md_lookup_func_oid (void *spec, void *data) if (oid_specs) { for (i = 0; oid_specs[i].oidstring && (! ret); i++) - if (! stricmp (oid, oid_specs[i].oidstring)) + if (!_stricmp (oid, oid_specs[i].oidstring)) ret = 1; } @@ -313,7 +313,7 @@ search_oid (const char *oid, int *algorithm, gcry_md_oid_spec_t *oid_spec) int i; for (i = 0; digest->oids[i].oidstring && !ret; i++) - if (! stricmp (oid, digest->oids[i].oidstring)) + if (!_stricmp (oid, digest->oids[i].oidstring)) { if (algorithm) *algorithm = module->mod_id; diff --git a/plugins/MirOTR/libgcrypt-1.4.6/cipher/pubkey.c b/plugins/MirOTR/libgcrypt-1.4.6/cipher/pubkey.c index 08abcbfdec..f163ea1696 100644 --- a/plugins/MirOTR/libgcrypt-1.4.6/cipher/pubkey.c +++ b/plugins/MirOTR/libgcrypt-1.4.6/cipher/pubkey.c @@ -231,10 +231,10 @@ gcry_pk_lookup_func_name (void *spec, void *data) gcry_pk_spec_t *pubkey = (gcry_pk_spec_t *) spec; char *name = (char *) data; const char **aliases = pubkey->aliases; - int ret = stricmp (name, pubkey->name); + int ret = _stricmp (name, pubkey->name); while (ret && *aliases) - ret = stricmp (name, *aliases++); + ret = _stricmp (name, *aliases++); return ! ret; } @@ -2712,7 +2712,7 @@ _gcry_pk_get_elements (int algo, char **enc, char **sig) if (enc) { - enc_cp = strdup (spec->elements_enc); + enc_cp = _strdup (spec->elements_enc); if (! enc_cp) { err = gpg_err_code_from_errno (errno); @@ -2722,7 +2722,7 @@ _gcry_pk_get_elements (int algo, char **enc, char **sig) if (sig) { - sig_cp = strdup (spec->elements_sig); + sig_cp = _strdup (spec->elements_sig); if (! sig_cp) { err = gpg_err_code_from_errno (errno); diff --git a/plugins/MirOTR/libgcrypt-1.4.6/random/random-csprng.c b/plugins/MirOTR/libgcrypt-1.4.6/random/random-csprng.c index 6ab868ae37..ccb90ee863 100644 --- a/plugins/MirOTR/libgcrypt-1.4.6/random/random-csprng.c +++ b/plugins/MirOTR/libgcrypt-1.4.6/random/random-csprng.c @@ -743,9 +743,9 @@ read_seed_file (void) return 0; #ifdef HAVE_DOSISH_SYSTEM - fd = open( seed_file_name, O_RDONLY | O_BINARY ); + fd = _open( seed_file_name, O_RDONLY | O_BINARY ); #else - fd = open( seed_file_name, O_RDONLY ); + fd = _open( seed_file_name, O_RDONLY ); #endif if( fd == -1 && errno == ENOENT) { @@ -760,49 +760,49 @@ read_seed_file (void) } if (lock_seed_file (fd, seed_file_name, 0)) { - close (fd); + _close (fd); return 0; } if (fstat( fd, &sb ) ) { log_info(_("can't stat `%s': %s\n"), seed_file_name, strerror(errno) ); - close(fd); + _close(fd); return 0; } if (!S_ISREG(sb.st_mode) ) { log_info(_("`%s' is not a regular file - ignored\n"), seed_file_name ); - close(fd); + _close(fd); return 0; } if (!sb.st_size ) { log_info(_("note: random_seed file is empty\n") ); - close(fd); + _close(fd); allow_seed_file_update = 1; return 0; } if (sb.st_size != POOLSIZE ) { log_info(_("warning: invalid size of random_seed file - not used\n") ); - close(fd); + _close(fd); return 0; } do { - n = read( fd, buffer, POOLSIZE ); + n = _read( fd, buffer, POOLSIZE ); } while (n == -1 && errno == EINTR ); if (n != POOLSIZE) { log_fatal(_("can't read `%s': %s\n"), seed_file_name,strerror(errno) ); - close(fd);/*NOTREACHED*/ + _close(fd);/*NOTREACHED*/ return 0; } - close(fd); + _close(fd); add_randomness( buffer, POOLSIZE, RANDOM_ORIGIN_INIT ); /* add some minor entropy to the pool now (this will also force a mixing) */ @@ -870,13 +870,13 @@ _gcry_rngcsprng_update_seed_file (void) mix_pool(keypool); rndstats.mixkey++; #if defined(HAVE_DOSISH_SYSTEM) || defined(__CYGWIN__) - fd = open (seed_file_name, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, + fd = _open (seed_file_name, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, S_IRUSR|S_IWUSR ); #else # if LOCK_SEED_FILE - fd = open (seed_file_name, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR ); + fd = _open (seed_file_name, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR ); # else - fd = open (seed_file_name, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR ); + fd = _open (seed_file_name, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR ); # endif #endif @@ -884,7 +884,7 @@ _gcry_rngcsprng_update_seed_file (void) log_info (_("can't create `%s': %s\n"), seed_file_name, strerror(errno) ); else if (lock_seed_file (fd, seed_file_name, 1)) { - close (fd); + _close (fd); } #if LOCK_SEED_FILE else if (ftruncate (fd, 0)) @@ -897,12 +897,12 @@ _gcry_rngcsprng_update_seed_file (void) { do { - i = write (fd, keypool, POOLSIZE ); + i = _write (fd, keypool, POOLSIZE ); } while (i == -1 && errno == EINTR); if (i != POOLSIZE) log_info (_("can't write `%s': %s\n"),seed_file_name, strerror(errno)); - if (close(fd)) + if (_close(fd)) log_info (_("can't close `%s': %s\n"),seed_file_name, strerror(errno)); } diff --git a/plugins/MirOTR/libgcrypt-1.4.6/random/rndw32.c b/plugins/MirOTR/libgcrypt-1.4.6/random/rndw32.c index 55b7256aba..05cc952b7a 100644 --- a/plugins/MirOTR/libgcrypt-1.4.6/random/rndw32.c +++ b/plugins/MirOTR/libgcrypt-1.4.6/random/rndw32.c @@ -258,16 +258,16 @@ init_system_rng (void) system_rng_available = 0; hRNGProv = NULL; - hAdvAPI32 = GetModuleHandle ("AdvAPI32.dll"); + hAdvAPI32 = GetModuleHandleA("AdvAPI32.dll"); if (!hAdvAPI32) return; pCryptAcquireContext = (CRYPTACQUIRECONTEXT) - GetProcAddress (hAdvAPI32, "CryptAcquireContextA"); + GetProcAddress(hAdvAPI32, "CryptAcquireContextA"); pCryptGenRandom = (CRYPTGENRANDOM) - GetProcAddress (hAdvAPI32, "CryptGenRandom"); + GetProcAddress(hAdvAPI32, "CryptGenRandom"); pCryptReleaseContext = (CRYPTRELEASECONTEXT) - GetProcAddress (hAdvAPI32, "CryptReleaseContext"); + GetProcAddress(hAdvAPI32, "CryptReleaseContext"); /* Get a pointer to the native randomness function if it's available. This isn't exported by name, so we have to get it by ordinal. */ @@ -336,7 +336,7 @@ read_mbm_data (void (*add)(const void*, size_t, enum random_origins), HANDLE hMBMData; SharedData *mbmDataPtr; - hMBMData = OpenFileMapping (FILE_MAP_READ, FALSE, "$M$B$M$5$S$D$" ); + hMBMData = OpenFileMapping (FILE_MAP_READ, FALSE, _T("$M$B$M$5$S$D$")); if (hMBMData) { mbmDataPtr = (SharedData*)MapViewOfFile (hMBMData, FILE_MAP_READ,0,0,0); @@ -425,7 +425,7 @@ registry_poll (void (*add)(const void*, size_t, enum random_origins), if ( debug_me ) log_debug ("rndw32#slow_gatherer_nt: get perf data\n" ); - status = RegQueryValueEx (HKEY_PERFORMANCE_DATA, "Global", NULL, + status = RegQueryValueEx (HKEY_PERFORMANCE_DATA, _T("Global"), NULL, NULL, (LPBYTE) pPerfData, &dwSize); if (status == ERROR_SUCCESS) { @@ -488,7 +488,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins), log_debug ("rndw32#slow_gatherer: init toolkit\n" ); /* Find out whether this is an NT server or workstation if necessary */ if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, - "SYSTEM\\CurrentControlSet\\Control\\ProductOptions", + _T("SYSTEM\\CurrentControlSet\\Control\\ProductOptions"), 0, KEY_READ, &hKey) == ERROR_SUCCESS) { BYTE szValue[32 + 8]; @@ -497,9 +497,9 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins), if ( debug_me ) log_debug ("rndw32#slow_gatherer: check product options\n" ); - status = RegQueryValueEx (hKey, "ProductType", 0, NULL, + status = RegQueryValueEx (hKey, _T("ProductType"), 0, NULL, szValue, &dwSize); - if (status == ERROR_SUCCESS && stricmp (szValue, "WinNT")) + if (status == ERROR_SUCCESS && _stricmp (szValue, "WinNT")) { /* Note: There are (at least) three cases for ProductType: WinNT = NT Workstation, ServerNT = NT Server, LanmanNT = @@ -516,7 +516,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins), /* readPnPData (); - we have not implemented that. */ /* Initialize the NetAPI32 function pointers if necessary */ - hNetAPI32 = LoadLibrary ("NETAPI32.DLL"); + hNetAPI32 = LoadLibraryA("NETAPI32.DLL"); if (hNetAPI32) { if (debug_me) @@ -537,7 +537,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins), } /* Initialize the NT kernel native API function pointers if necessary */ - hNTAPI = GetModuleHandle ("NTDll.dll"); + hNTAPI = GetModuleHandleA("NTDll.dll"); if (hNTAPI) { /* Get a pointer to the NT native information query functions */ @@ -590,7 +590,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins), /* Check whether we can access this device. */ snprintf (szDevice, sizeof szDevice, "\\\\.\\PhysicalDrive%d", drive_no); - hDevice = CreateFile (szDevice, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, + hDevice = CreateFileA(szDevice, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); if (hDevice == INVALID_HANDLE_VALUE) break; /* No more drives. */ diff --git a/plugins/MirOTR/libgcrypt-1.4.6/src/ath.c b/plugins/MirOTR/libgcrypt-1.4.6/src/ath.c index 0c274cde0c..a3d300c1b9 100644 --- a/plugins/MirOTR/libgcrypt-1.4.6/src/ath.c +++ b/plugins/MirOTR/libgcrypt-1.4.6/src/ath.c @@ -224,7 +224,7 @@ ath_read (int fd, void *buf, size_t nbytes) if (ops_set && ops.read) return (*ops.read) (fd, buf, nbytes); else - return read (fd, buf, nbytes); + return _read (fd, buf, nbytes); } @@ -234,7 +234,7 @@ ath_write (int fd, const void *buf, size_t nbytes) if (ops_set && ops.write) return (*ops.write) (fd, buf, nbytes); else - return write (fd, buf, nbytes); + return _write (fd, buf, nbytes); } diff --git a/plugins/MirOTR/libgcrypt-1.4.6/src/fips.c b/plugins/MirOTR/libgcrypt-1.4.6/src/fips.c index 91f30427c5..8709dae96d 100644 --- a/plugins/MirOTR/libgcrypt-1.4.6/src/fips.c +++ b/plugins/MirOTR/libgcrypt-1.4.6/src/fips.c @@ -128,7 +128,7 @@ _gcry_initialize_fips_mode (int force) file. The filename is hardwired so that there won't be any confusion on whether /etc/gcrypt/ or /usr/local/etc/gcrypt/ is actually used. The file itself may be empty. */ - if ( !access (FIPS_FORCE_FILE, F_OK) ) + if ( !_access (FIPS_FORCE_FILE, F_OK) ) { gcry_assert (!no_fips_mode_required); goto leave; @@ -156,7 +156,7 @@ _gcry_initialize_fips_mode (int force) } else if ((saved_errno = errno) != ENOENT && saved_errno != EACCES - && !access ("/proc/version", F_OK) ) + && !_access ("/proc/version", F_OK) ) { /* Problem reading the fips file despite that we have the proc file system. We better stop right away. */ diff --git a/plugins/MirOTR/libgcrypt-1.4.6/src/gcrypt.h b/plugins/MirOTR/libgcrypt-1.4.6/src/gcrypt.h index 8c110fec0b..ef4196c266 100644 --- a/plugins/MirOTR/libgcrypt-1.4.6/src/gcrypt.h +++ b/plugins/MirOTR/libgcrypt-1.4.6/src/gcrypt.h @@ -25,6 +25,7 @@ #include <stdlib.h> #include <stdarg.h> #include <string.h> +#include <tchar.h> #include <gpg-error.h> diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index 3ee85fa4d3..134e10ba22 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -315,7 +315,7 @@ static void __cdecl PopupThread(void *arg) }
// Increment Miranda thread counter
- CallService(MS_SYSTEM_THREAD_PUSH, 0, 0);
+ Thread_Push(0);
// Create manager window
DWORD err;
@@ -353,7 +353,7 @@ static void __cdecl PopupThread(void *arg) ReleaseMutex(hThreadMutex);
// Decrement Miranda thread counter
- CallService(MS_SYSTEM_THREAD_POP, 0, 0);
+ Thread_Pop();
// Ok, now we can kill this thread
_endthread();
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index 963e4e4a95..6b9755f532 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -1818,7 +1818,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(HWND hwnd, UINT message, WPARAM wParam, L void WindowThread(void *arg)
{
- CallService(MS_SYSTEM_THREAD_PUSH, 0, 0);
+ Thread_Push(0);
OleInitialize(NULL); // we may need OLE in this thread for smiley substitution
PopupWnd2 *wnd = (PopupWnd2 *)arg;
@@ -1833,7 +1833,7 @@ void WindowThread(void *arg) DispatchMessage(&msg);
}
- CallService(MS_SYSTEM_THREAD_POP, 0, 0);
+ Thread_Pop();
_endthread();
}
diff --git a/plugins/SeenPlugin/utils.cpp b/plugins/SeenPlugin/utils.cpp index 1cfc5a2a82..e33d6edfa0 100644 --- a/plugins/SeenPlugin/utils.cpp +++ b/plugins/SeenPlugin/utils.cpp @@ -633,8 +633,6 @@ static DWORD __stdcall waitThread(logthread_info* infoParam) int UpdateValues(WPARAM wparam,LPARAM lparam)
{
- FORK_THREADEX_PARAMS params;
- DWORD dwThreadId;
DBCONTACTWRITESETTING *cws;
BOOL isIdleEvent;
// to make this code faster
@@ -715,16 +713,9 @@ int UpdateValues(WPARAM wparam,LPARAM lparam) if (!(index = isContactQueueActive((HANDLE)wparam))) {
index = addContactToQueue((HANDLE)wparam);
strncpy(contactQueue[index]->sProtoName,cws->szModule,MAXMODULELABELLENGTH);
- //forkthreadex(NULL, 0, waitThread, contactQueue[index], 0, 0);
- params.pFunc = (pThreadFuncEx)waitThread;
- params.arg = contactQueue[index];
- params.iStackSize = 0;
- params.threadID = (unsigned int *)&dwThreadId;
- CallService(MS_SYSTEM_FORK_THREAD_EX, 0, (LPARAM)¶ms);
-
-
-// } else {
-// MessageBox(0,"Already in contact queue",cws->szModule,0);
+
+ unsigned int dwThreadId;
+ forkthreadex(NULL, 0, (pThreadFuncEx)waitThread, contactQueue[index], 0, &dwThreadId);
}
contactQueue[index]->courStatus = isIdleEvent ? DBGetContactSettingWord((HANDLE)wparam, cws->szModule, "Status", ID_STATUS_OFFLINE) : cws->value.wVal;
} }
@@ -785,8 +776,6 @@ int ModeChange(WPARAM wparam,LPARAM lparam) {
ACKDATA *ack;
WORD isetting=0;
- FORK_THREADEX_PARAMS params;
- DWORD dwThreadId;
ack=(ACKDATA *)lparam;
@@ -812,13 +801,9 @@ int ModeChange(WPARAM wparam,LPARAM lparam) strncpy(info->sProtoName,courProtoName,MAXMODULELABELLENGTH);
info->hContact = 0;
info->courStatus = 0;
- //forkthreadex(NULL, 0, cleanThread, info, 0, 0);
- params.pFunc = (pThreadFuncEx)cleanThread;
- params.arg = info;
- params.iStackSize = 0;
- params.threadID = (unsigned int *)&dwThreadId;
- CallService(MS_SYSTEM_FORK_THREAD_EX, 0, (LPARAM)¶ms);
+ unsigned int dwThreadId;
+ forkthreadex(NULL, 0, (pThreadFuncEx)cleanThread, info, 0, &dwThreadId);
}
} else if ((isetting==ID_STATUS_OFFLINE)&&((WORD)ack->hProcess>ID_STATUS_OFFLINE)) {
//we have just loged-off
|