summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/MirOTR/Libgcrypt/random/rndw32.c22
-rw-r--r--plugins/MirOTR/src/svcs_proto.cpp28
2 files changed, 17 insertions, 33 deletions
diff --git a/plugins/MirOTR/Libgcrypt/random/rndw32.c b/plugins/MirOTR/Libgcrypt/random/rndw32.c
index c495131de8..5f988026e1 100644
--- a/plugins/MirOTR/Libgcrypt/random/rndw32.c
+++ b/plugins/MirOTR/Libgcrypt/random/rndw32.c
@@ -80,7 +80,7 @@
#include <winsock2.h>
#include <windows.h>
-
+#include <tchar.h>
#include "types.h"
#include "g10lib.h"
@@ -259,7 +259,7 @@ init_system_rng (void)
system_rng_available = 0;
hRNGProv = NULL;
- hAdvAPI32 = GetModuleHandle ("AdvAPI32.dll");
+ hAdvAPI32 = GetModuleHandleA("AdvAPI32.dll");
if (!hAdvAPI32)
return;
@@ -282,7 +282,7 @@ init_system_rng (void)
as well, mostly due to virtually nonexistent support/marketing by
Intel, it's included here mostly for form's sake. */
if ( (!pCryptAcquireContext || !pCryptGenRandom || !pCryptReleaseContext
- || !pCryptAcquireContext (&hRNGProv, NULL, INTEL_DEF_PROV,
+ || !pCryptAcquireContext (&hRNGProv, NULL, _T(INTEL_DEF_PROV),
PROV_INTEL_SEC, 0) )
&& !pRtlGenRandom)
{
@@ -337,7 +337,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 = OpenFileMappingA(FILE_MAP_READ, FALSE, "$M$B$M$5$S$D$" );
if (hMBMData)
{
mbmDataPtr = (SharedData*)MapViewOfFile (hMBMData, FILE_MAP_READ,0,0,0);
@@ -438,7 +438,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 = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "Global", NULL,
NULL, (LPBYTE) pPerfData, &dwSize);
if (status == ERROR_SUCCESS)
{
@@ -501,7 +501,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins),
if ( debug_me )
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,
+ if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
"SYSTEM\\CurrentControlSet\\Control\\ProductOptions",
0, KEY_READ, &hKey) == ERROR_SUCCESS)
{
@@ -511,7 +511,7 @@ 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 = RegQueryValueExA(hKey, "ProductType", 0, NULL,
szValue, &dwSize);
if (status == ERROR_SUCCESS && stricmp (szValue, "WinNT"))
{
@@ -530,7 +530,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)
@@ -551,7 +551,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 */
@@ -604,7 +604,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. */
@@ -888,7 +888,7 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t,
{
HANDLE handle;
FILETIME creationTime, exitTime, kernelTime, userTime;
- DWORD minimumWorkingSetSize, maximumWorkingSetSize;
+ SIZE_T minimumWorkingSetSize, maximumWorkingSetSize;
handle = GetCurrentThread ();
GetThreadTimes (handle, &creationTime, &exitTime,
diff --git a/plugins/MirOTR/src/svcs_proto.cpp b/plugins/MirOTR/src/svcs_proto.cpp
index 99592f354b..545f5574b7 100644
--- a/plugins/MirOTR/src/svcs_proto.cpp
+++ b/plugins/MirOTR/src/svcs_proto.cpp
@@ -100,16 +100,8 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
}
INT_PTR ret = CallService(MS_PROTO_CHAINSEND, wParam, lParam);
-#ifdef _DEBUG
- if(ccs->wParam & PREF_UNICODE)
- {
- TCHAR *mes = mir_a2t((const char *)ccs->lParam);
- MessageBox(0, mes, _T("OTR - sending raw message"), MB_OK);
- mir_free(mes);
- }
- else
- MessageBoxA(0, (char *)ccs->lParam, ("OTR - sending raw message"), MB_OK);
-#endif
+ DEBUGOUTA("OTR - sending raw message: ");
+ DEBUGOUTA((char *)ccs->lParam);
// reset to original values
ccs->lParam = (LPARAM)oldmessage;
@@ -126,21 +118,13 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
#define MESSAGE_PREFIX_LEN 6
*/
-INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
- //PUShowMessage("OTR Recv Message", SM_NOTIFY);
+INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam)
+{
CCSDATA *ccs = (CCSDATA *) lParam;
PROTORECVEVENT *pre = (PROTORECVEVENT *) ccs->lParam;
-#ifdef _DEBUG
- if(pre->flags & PREF_UNICODE)
- {
- TCHAR *mes = mir_a2t(pre->szMessage);
- MessageBox(0, mes, _T("OTR - receiving message"), MB_OK);
- mir_free(mes);
- }
- else
- MessageBoxA(0, (char *)pre->szMessage, ("OTR - receiving message"), MB_OK);
-#endif
+ DEBUGOUTA("OTR - receiving message: ");
+ DEBUGOUTA((char *)ccs->lParam);
if (pre->flags & PREF_BYPASS_OTR) { // bypass for our inline messages
return CallService(MS_PROTO_CHAINRECV, wParam, lParam);