summaryrefslogtreecommitdiff
path: root/protocols/YAMN
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-26 20:31:39 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-26 20:31:39 +0300
commitcddcd7483a7c472598af098e759e5d309024f606 (patch)
treeb0a227d6e087c41958cc84d27bc323353248aae5 /protocols/YAMN
parent1039b2829a264280493ba0fa979214fe024dc70c (diff)
DWORD -> uint32_t
Diffstat (limited to 'protocols/YAMN')
-rw-r--r--protocols/YAMN/src/account.cpp139
-rw-r--r--protocols/YAMN/src/browser/badconnect.cpp4
-rw-r--r--protocols/YAMN/src/browser/browser.h6
-rw-r--r--protocols/YAMN/src/browser/mailbrowser.cpp32
-rw-r--r--protocols/YAMN/src/debug.cpp8
-rw-r--r--protocols/YAMN/src/debug.h8
-rw-r--r--protocols/YAMN/src/filterplugin.cpp4
-rw-r--r--protocols/YAMN/src/mails/decode.cpp8
-rw-r--r--protocols/YAMN/src/mails/mails.cpp12
-rw-r--r--protocols/YAMN/src/proto/netclient.h4
-rw-r--r--protocols/YAMN/src/proto/netlib.cpp16
-rw-r--r--protocols/YAMN/src/proto/pop3/pop3.cpp34
-rw-r--r--protocols/YAMN/src/proto/pop3/pop3.h2
-rw-r--r--protocols/YAMN/src/proto/pop3/pop3comm.cpp80
-rw-r--r--protocols/YAMN/src/proto/pop3/pop3comm.h10
-rw-r--r--protocols/YAMN/src/proto/pop3/pop3opt.cpp8
-rw-r--r--protocols/YAMN/src/protoplugin.cpp4
-rw-r--r--protocols/YAMN/src/services.cpp2
-rw-r--r--protocols/YAMN/src/stdafx.h32
-rw-r--r--protocols/YAMN/src/synchro.cpp42
-rw-r--r--protocols/YAMN/src/yamn.cpp6
21 files changed, 231 insertions, 230 deletions
diff --git a/protocols/YAMN/src/account.cpp b/protocols/YAMN/src/account.cpp
index 302249841e..9749462f24 100644
--- a/protocols/YAMN/src/account.cpp
+++ b/protocols/YAMN/src/account.cpp
@@ -40,7 +40,7 @@ struct CExportedServices AccountExportedSvc[] =
INT_PTR CreatePluginAccountSvc(WPARAM wParam, LPARAM lParam)
{
HYAMNPROTOPLUGIN Plugin = (HYAMNPROTOPLUGIN)wParam;
- DWORD AccountVersion = (DWORD)lParam;
+ uint32_t AccountVersion = (uint32_t)lParam;
//test if we are going to initialize members of suitable structure (structures of plugin and YAMN must match)
if (AccountVersion != YAMN_ACCOUNTVERSION)
@@ -177,7 +177,7 @@ void CodeDecodeString(char *Dest, BOOL Encrypt)
}
}
-static DWORD PostFileToMemory(HANDLE File, char **MemFile, char **End)
+static uint32_t PostFileToMemory(HANDLE File, char **MemFile, char **End)
{
DWORD FileSize, ReadBytes;
if (!(FileSize = GetFileSize(File, nullptr))) {
@@ -204,7 +204,7 @@ static DWORD PostFileToMemory(HANDLE File, char **MemFile, char **End)
return 0;
}
-DWORD FileToMemory(wchar_t *FileName, char **MemFile, char **End)
+uint32_t FileToMemory(wchar_t *FileName, char **MemFile, char **End)
{
HANDLE hFile = CreateFile(FileName, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
if (hFile == INVALID_HANDLE_VALUE)
@@ -214,12 +214,12 @@ DWORD FileToMemory(wchar_t *FileName, char **MemFile, char **End)
}
#if defined(DEBUG_FILEREAD) || defined(DEBUG_FILEREADMESSAGES)
-DWORD ReadStringFromMemory(char **Parser,wchar_t *End,char **StoreTo,wchar_t *DebugString)
+uint32_t ReadStringFromMemory(char **Parser,wchar_t *End,char **StoreTo,wchar_t *DebugString)
{
//This is the debug version of ReadStringFromMemory function. This version shows MessageBox where
//read string is displayed
wchar_t *Dest,*Finder;
- DWORD Size;
+ uint32_t Size;
wchar_t Debug[65536];
Finder=*Parser;
@@ -244,10 +244,10 @@ DWORD ReadStringFromMemory(char **Parser,wchar_t *End,char **StoreTo,wchar_t *De
}
#endif
-DWORD ReadStringFromMemory(char **Parser, char *End, char **StoreTo)
+uint32_t ReadStringFromMemory(char **Parser, char *End, char **StoreTo)
{
char *Dest, *Finder;
- DWORD Size;
+ uint32_t Size;
Finder = *Parser;
while ((*Finder != (wchar_t)0) && (Finder <= End)) Finder++;
@@ -269,12 +269,12 @@ DWORD ReadStringFromMemory(char **Parser, char *End, char **StoreTo)
}
#if defined(DEBUG_FILEREAD) || defined(DEBUG_FILEREADMESSAGES)
-DWORD ReadStringFromMemoryW(wchar_t **Parser,wchar_t *End,wchar_t **StoreTo,wchar_t *DebugString)
+uint32_t ReadStringFromMemoryW(wchar_t **Parser,wchar_t *End,wchar_t **StoreTo,wchar_t *DebugString)
{
//This is the debug version of ReadStringFromMemoryW function. This version shows MessageBox where
//read string is displayed
wchar_t *Dest,*Finder;
- DWORD Size;
+ uint32_t Size;
wchar_t Debug[65536];
Finder=*Parser;
@@ -299,10 +299,10 @@ DWORD ReadStringFromMemoryW(wchar_t **Parser,wchar_t *End,wchar_t **StoreTo,wcha
}
#endif //if defined(DEBUG...)
-DWORD ReadStringFromMemoryW(wchar_t **Parser, wchar_t *End, wchar_t **StoreTo)
+uint32_t ReadStringFromMemoryW(wchar_t **Parser, wchar_t *End, wchar_t **StoreTo)
{
wchar_t *Dest, *Finder;
- DWORD Size;
+ uint32_t Size;
Finder = *Parser;
while ((*Finder != (wchar_t)0) && (Finder <= (wchar_t *)End)) Finder++;
@@ -323,15 +323,15 @@ DWORD ReadStringFromMemoryW(wchar_t **Parser, wchar_t *End, wchar_t **StoreTo)
return 0;
}
-static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICATION *Which)
+static uint32_t ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICATION *Which)
{
- DWORD Stat;
+ uint32_t Stat;
#ifdef DEBUG_FILEREAD
wchar_t Debug[65536];
#endif
- Which->Flags = *(DWORD *)(*Parser);
- (*Parser) += sizeof(DWORD);
+ Which->Flags = *(uint32_t *)(*Parser);
+ (*Parser) += sizeof(uint32_t);
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
@@ -355,8 +355,8 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT
mir_snwprintf(Debug, L"PopupT: %04x, remaining %d chars", Which->PopupT, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
- Which->PopupTime = *(DWORD *)(*Parser);
- (*Parser) += sizeof(DWORD);
+ Which->PopupTime = *(uint32_t *)(*Parser);
+ (*Parser) += sizeof(uint32_t);
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
@@ -379,10 +379,10 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT
return 0;
}
-DWORD ReadMessagesFromMemory(CAccount *Which, char **Parser, char *End)
+uint32_t ReadMessagesFromMemory(CAccount *Which, char **Parser, char *End)
{
char *Finder;
- DWORD Size, Stat;
+ uint32_t Size, Stat;
HYAMNMAIL ActualMail = nullptr;
struct CMimeItem *items;
char *ReadString;
@@ -419,16 +419,16 @@ DWORD ReadMessagesFromMemory(CAccount *Which, char **Parser, char *End)
return Stat;
// ActualMail->MailData=new MAILDATA; !!! mem leake !!! this is alloc by CreateAccountMail, no need for doubble alloc !!!!
- ActualMail->MailData->Size = *(DWORD *)(*Parser);
- (*Parser) += sizeof(DWORD);
+ ActualMail->MailData->Size = *(uint32_t *)(*Parser);
+ (*Parser) += sizeof(uint32_t);
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
- ActualMail->Flags = *(DWORD *)(*Parser);
- (*Parser) += sizeof(DWORD);
+ ActualMail->Flags = *(uint32_t *)(*Parser);
+ (*Parser) += sizeof(uint32_t);
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
- ActualMail->Number = *(DWORD *)(*Parser);
- (*Parser) += sizeof(DWORD);
+ ActualMail->Number = *(uint32_t *)(*Parser);
+ (*Parser) += sizeof(uint32_t);
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
@@ -481,9 +481,9 @@ DWORD ReadMessagesFromMemory(CAccount *Which, char **Parser, char *End)
return 0;
}
-DWORD ReadAccountFromMemory(CAccount *Which, char **Parser, char *End)
+uint32_t ReadAccountFromMemory(CAccount *Which, char **Parser, char *End)
{
- DWORD Stat;
+ uint32_t Stat;
#ifdef DEBUG_FILEREAD
wchar_t Debug[65536];
#endif
@@ -528,22 +528,22 @@ DWORD ReadAccountFromMemory(CAccount *Which, char **Parser, char *End)
CodeDecodeString(Which->Server->Passwd, FALSE);
//Read account flags
- Which->Flags = *(DWORD *)(*Parser);
- (*Parser) += sizeof(DWORD);
+ Which->Flags = *(uint32_t *)(*Parser);
+ (*Parser) += sizeof(uint32_t);
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
mir_snwprintf(Debug, L"Flags: %04x, remaining %d chars", Which->Flags, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
- Which->StatusFlags = *(DWORD *)(*Parser);
- (*Parser) += sizeof(DWORD);
+ Which->StatusFlags = *(uint32_t *)(*Parser);
+ (*Parser) += sizeof(uint32_t);
#ifdef DEBUG_FILEREAD
mir_snwprintf(Debug, L"STFlags: %04x, remaining %d chars", Which->StatusFlags, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
#endif
- Which->PluginFlags = *(DWORD *)(*Parser);
- (*Parser) += sizeof(DWORD);
+ Which->PluginFlags = *(uint32_t *)(*Parser);
+ (*Parser) += sizeof(uint32_t);
#ifdef DEBUG_FILEREAD
mir_snwprintf(Debug, L"PFlags: %04x, remaining %d chars", Which->PluginFlags, End-*Parser);
MessageBox(NULL,Debug,L"debug",MB_OK);
@@ -636,11 +636,11 @@ static INT_PTR PerformAccountReading(HYAMNPROTOPLUGIN Plugin, char *MemFile, cha
{
//Retrieve info for account from memory
char *Parser;
- DWORD Ver, Stat;
+ uint32_t Ver, Stat;
CAccount *ActualAccount, *FirstAllocatedAccount;
- Ver = *(DWORD *)MemFile;
+ Ver = *(uint32_t *)MemFile;
if (Ver > YAMN_ACCOUNTFILEVERSION)
{
delete[] MemFile;
@@ -735,19 +735,19 @@ static INT_PTR PerformAccountReading(HYAMNPROTOPLUGIN Plugin, char *MemFile, cha
INT_PTR AddAccountsFromFileSvc(WPARAM wParam, LPARAM lParam)
{
char *MemFile, *End;
- DWORD Stat = FileToMemory((wchar_t*)lParam, &MemFile, &End);
+ uint32_t Stat = FileToMemory((wchar_t*)lParam, &MemFile, &End);
if (Stat != NO_ERROR)
return (INT_PTR)Stat;
return PerformAccountReading((HYAMNPROTOPLUGIN)wParam, MemFile, End);
}
-DWORD WriteStringToFile(HANDLE File, char *Source)
+uint32_t WriteStringToFile(HANDLE File, char *Source)
{
DWORD Length, WrittenBytes;
char null = 0;
- if ((Source == nullptr) || !(Length = (DWORD)mir_strlen(Source))) {
+ if ((Source == nullptr) || !(Length = (uint32_t)mir_strlen(Source))) {
if (!WriteFile(File, &null, 1, &WrittenBytes, nullptr)) {
CloseHandle(File);
return EACC_SYSTEM;
@@ -760,12 +760,12 @@ DWORD WriteStringToFile(HANDLE File, char *Source)
return 0;
}
-DWORD WriteStringToFileW(HANDLE File, wchar_t *Source)
+uint32_t WriteStringToFileW(HANDLE File, wchar_t *Source)
{
DWORD Length, WrittenBytes;
wchar_t null = (wchar_t)0;
- if ((Source == nullptr) || !(Length = (DWORD)mir_wstrlen(Source)))
+ if ((Source == nullptr) || !(Length = (uint32_t)mir_wstrlen(Source)))
{
if (!WriteFile(File, &null, sizeof(wchar_t), &WrittenBytes, nullptr))
{
@@ -788,6 +788,7 @@ DWORD WriteMessagesToFile(HANDLE File, CAccount *Which)
{
if (Stat = WriteStringToFile(File, ActualMail->ID))
return Stat;
+
if (!WriteFile(File, (char *)&ActualMail->MailData->Size, sizeof(ActualMail->MailData->Size), &WrittenBytes, nullptr) ||
!WriteFile(File, (char *)&ActualMail->Flags, sizeof(ActualMail->Flags), &WrittenBytes, nullptr) ||
!WriteFile(File, (char *)&ActualMail->Number, sizeof(ActualMail->Number), &WrittenBytes, nullptr))
@@ -814,9 +815,9 @@ static INT_PTR PerformAccountWriting(HYAMNPROTOPLUGIN Plugin, HANDLE File)
{
DWORD WrittenBytes, Stat;
CAccount *ActualAccount;
- DWORD Ver = YAMN_ACCOUNTFILEVERSION;
+ uint32_t Ver = YAMN_ACCOUNTFILEVERSION;
BOOL Writed = FALSE;
- DWORD ReturnValue = 0, EnterCode;
+ uint32_t ReturnValue = 0, EnterCode;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"WriteAccountsToFile:AccountBrowserSO-read wait\n");
@@ -856,72 +857,72 @@ static INT_PTR PerformAccountWriting(HYAMNPROTOPLUGIN Plugin, HANDLE File)
}
if (!Writed && !WriteFile(File, &Ver, sizeof(Ver), &WrittenBytes, nullptr))
- throw (DWORD)EACC_SYSTEM;
+ throw (uint32_t)EACC_SYSTEM;
Writed = TRUE;
if (Stat = WriteStringToFile(File, ActualAccount->Name))
- throw (DWORD)Stat;
+ throw (uint32_t)Stat;
if (Stat = WriteStringToFile(File, ActualAccount->Server->Name))
- throw (DWORD)Stat;
+ throw (uint32_t)Stat;
if (!WriteFile(File, (char *)&ActualAccount->Server->Port, 2, &WrittenBytes, nullptr))
- throw (DWORD)EACC_SYSTEM;
+ throw (uint32_t)EACC_SYSTEM;
if ((Stat = WriteStringToFile(File, ActualAccount->Server->Login)))
- throw (DWORD)Stat;
+ throw (uint32_t)Stat;
CodeDecodeString(ActualAccount->Server->Passwd, TRUE);
if (Stat = WriteStringToFile(File, ActualAccount->Server->Passwd))
{
CodeDecodeString(ActualAccount->Server->Passwd, FALSE);
- throw (DWORD)Stat;
+ throw (uint32_t)Stat;
}
CodeDecodeString(ActualAccount->Server->Passwd, FALSE);
- if ((!WriteFile(File, (char *)&ActualAccount->Flags, sizeof(DWORD), &WrittenBytes, nullptr) ||
- (!WriteFile(File, (char *)&ActualAccount->StatusFlags, sizeof(DWORD), &WrittenBytes, nullptr)) ||
- (!WriteFile(File, (char *)&ActualAccount->PluginFlags, sizeof(DWORD), &WrittenBytes, nullptr))))
- throw (DWORD)EACC_SYSTEM;
+ if ((!WriteFile(File, (char *)&ActualAccount->Flags, sizeof(uint32_t), &WrittenBytes, nullptr) ||
+ (!WriteFile(File, (char *)&ActualAccount->StatusFlags, sizeof(uint32_t), &WrittenBytes, nullptr)) ||
+ (!WriteFile(File, (char *)&ActualAccount->PluginFlags, sizeof(uint32_t), &WrittenBytes, nullptr))))
+ throw (uint32_t)EACC_SYSTEM;
if (!WriteFile(File, (char *)&ActualAccount->Interval, sizeof(uint16_t), &WrittenBytes, nullptr))
- throw (DWORD)EACC_SYSTEM;
+ throw (uint32_t)EACC_SYSTEM;
- if ((!WriteFile(File, (char *)&ActualAccount->NewMailN.Flags, sizeof(DWORD), &WrittenBytes, nullptr)) ||
+ if ((!WriteFile(File, (char *)&ActualAccount->NewMailN.Flags, sizeof(uint32_t), &WrittenBytes, nullptr)) ||
(!WriteFile(File, (char *)&ActualAccount->NewMailN.PopupB, sizeof(COLORREF), &WrittenBytes, nullptr)) ||
(!WriteFile(File, (char *)&ActualAccount->NewMailN.PopupT, sizeof(COLORREF), &WrittenBytes, nullptr)) ||
- (!WriteFile(File, (char *)&ActualAccount->NewMailN.PopupTime, sizeof(DWORD), &WrittenBytes, nullptr)))
- throw (DWORD)EACC_SYSTEM;
+ (!WriteFile(File, (char *)&ActualAccount->NewMailN.PopupTime, sizeof(uint32_t), &WrittenBytes, nullptr)))
+ throw (uint32_t)EACC_SYSTEM;
if ((Stat = WriteStringToFileW(File, ActualAccount->NewMailN.App)) ||
(Stat = WriteStringToFileW(File, ActualAccount->NewMailN.AppParam)))
- throw (DWORD)Stat;
+ throw (uint32_t)Stat;
- if ((!WriteFile(File, (char *)&ActualAccount->NoNewMailN.Flags, sizeof(DWORD), &WrittenBytes, nullptr)) ||
+ if ((!WriteFile(File, (char *)&ActualAccount->NoNewMailN.Flags, sizeof(uint32_t), &WrittenBytes, nullptr)) ||
(!WriteFile(File, (char *)&ActualAccount->NoNewMailN.PopupB, sizeof(COLORREF), &WrittenBytes, nullptr)) ||
(!WriteFile(File, (char *)&ActualAccount->NoNewMailN.PopupT, sizeof(COLORREF), &WrittenBytes, nullptr)) ||
- (!WriteFile(File, (char *)&ActualAccount->NoNewMailN.PopupTime, sizeof(DWORD), &WrittenBytes, nullptr)))
- throw (DWORD)EACC_SYSTEM;
+ (!WriteFile(File, (char *)&ActualAccount->NoNewMailN.PopupTime, sizeof(uint32_t), &WrittenBytes, nullptr)))
+ throw (uint32_t)EACC_SYSTEM;
if ((Stat = WriteStringToFileW(File, ActualAccount->NoNewMailN.App)) ||
(Stat = WriteStringToFileW(File, ActualAccount->NoNewMailN.AppParam)))
- throw (DWORD)Stat;
+ throw (uint32_t)Stat;
- if ((!WriteFile(File, (char *)&ActualAccount->BadConnectN.Flags, sizeof(DWORD), &WrittenBytes, nullptr)) ||
+ if ((!WriteFile(File, (char *)&ActualAccount->BadConnectN.Flags, sizeof(uint32_t), &WrittenBytes, nullptr)) ||
(!WriteFile(File, (char *)&ActualAccount->BadConnectN.PopupB, sizeof(COLORREF), &WrittenBytes, nullptr)) ||
(!WriteFile(File, (char *)&ActualAccount->BadConnectN.PopupT, sizeof(COLORREF), &WrittenBytes, nullptr)) ||
- (!WriteFile(File, (char *)&ActualAccount->BadConnectN.PopupTime, sizeof(DWORD), &WrittenBytes, nullptr)))
- throw (DWORD)EACC_SYSTEM;
+ (!WriteFile(File, (char *)&ActualAccount->BadConnectN.PopupTime, sizeof(uint32_t), &WrittenBytes, nullptr)))
+ throw (uint32_t)EACC_SYSTEM;
if ((Stat = WriteStringToFileW(File, ActualAccount->BadConnectN.App)) ||
(Stat = WriteStringToFileW(File, ActualAccount->BadConnectN.AppParam)))
- throw (DWORD)Stat;
+ throw (uint32_t)Stat;
//Let plugin write its own values into file
if (ActualAccount->Plugin->Fcn != nullptr && ActualAccount->Plugin->Fcn->WritePluginOptsFcnPtr != nullptr)
if (Stat = ActualAccount->Plugin->Fcn->WritePluginOptsFcnPtr(File, ActualAccount))
- throw (DWORD)Stat;
+ throw (uint32_t)Stat;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"WriteAccountsToFile:ActualAccountMsgsSO-read wait\n");
#endif
@@ -935,7 +936,7 @@ static INT_PTR PerformAccountWriting(HYAMNPROTOPLUGIN Plugin, HANDLE File)
DebugLog(SynchroFile,"WriteAccountsToFile:ActualAccountMsgsSO-read done\n");
#endif
ReadDoneFcn(ActualAccount->MessagesAccessSO);
- throw (DWORD)Stat;
+ throw (uint32_t)Stat;
}
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"WriteAccountsToFile:ActualAccountMsgsSO-read done\n");
@@ -946,7 +947,7 @@ static INT_PTR PerformAccountWriting(HYAMNPROTOPLUGIN Plugin, HANDLE File)
(!WriteFile(File, (char *)&ActualAccount->LastSChecked, sizeof(SYSTEMTIME), &WrittenBytes, nullptr)) ||
(!WriteFile(File, (char *)&ActualAccount->LastSynchronised, sizeof(SYSTEMTIME), &WrittenBytes, nullptr)) ||
(!WriteFile(File, (char *)&ActualAccount->LastMail, sizeof(SYSTEMTIME), &WrittenBytes, nullptr)))
- throw (DWORD)Stat;
+ throw (uint32_t)Stat;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"WriteAccountsToFile:ActualAccountSO-read done\n");
@@ -954,7 +955,7 @@ static INT_PTR PerformAccountWriting(HYAMNPROTOPLUGIN Plugin, HANDLE File)
ReadDoneFcn(ActualAccount->AccountAccessSO);
}
}
- catch (DWORD ErrorCode)
+ catch (uint32_t ErrorCode)
{
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"WriteAccountsToFile:ActualAccountSO-read done\n");
diff --git a/protocols/YAMN/src/browser/badconnect.cpp b/protocols/YAMN/src/browser/badconnect.cpp
index 04e50b0675..d69de06986 100644
--- a/protocols/YAMN/src/browser/badconnect.cpp
+++ b/protocols/YAMN/src/browser/badconnect.cpp
@@ -80,7 +80,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg, UINT msg, WPARAM wParam, LP
{
BOOL ShowPopup, ShowMsg, ShowIco;
CAccount *ActualAccount;
- DWORD ErrorCode;
+ uint32_t ErrorCode;
char* TitleStrA;
char *Message1A = nullptr;
wchar_t *Message1W = nullptr;
@@ -279,7 +279,7 @@ INT_PTR RunBadConnectionSvc(WPARAM wParam, LPARAM lParam)
{
// an event for successfull copy parameters to which point a pointer in stack for new thread
PYAMN_BADCONNECTIONPARAM Param = (PYAMN_BADCONNECTIONPARAM)wParam;
- if ((DWORD)lParam != YAMN_BADCONNECTIONVERSION)
+ if ((uint32_t)lParam != YAMN_BADCONNECTIONVERSION)
return 0;
HANDLE ThreadRunningEV = CreateEvent(nullptr, FALSE, FALSE, nullptr);
diff --git a/protocols/YAMN/src/browser/browser.h b/protocols/YAMN/src/browser/browser.h
index 381ecfb9f5..c825651dc0 100644
--- a/protocols/YAMN/src/browser/browser.h
+++ b/protocols/YAMN/src/browser/browser.h
@@ -6,8 +6,8 @@ typedef struct MailBrowserWinParam
#define YAMN_MAILBROWSERVERSION 1
HANDLE ThreadRunningEV;
CAccount *account;
- DWORD nflags; //flags YAMN_ACC_??? when new mails
- DWORD nnflags; //flags YAMN_ACC_??? when no new mails
+ uint32_t nflags; //flags YAMN_ACC_??? when new mails
+ uint32_t nnflags; //flags YAMN_ACC_??? when no new mails
void *Param;
} YAMN_MAILBROWSERPARAM,*PYAMN_MAILBROWSERPARAM;
@@ -23,7 +23,7 @@ typedef struct NoNewMailParam
#define YAMN_NONEWMAILVERSION 1
HANDLE ThreadRunningEV;
CAccount *account;
- DWORD flags;
+ uint32_t flags;
void *Param;
} YAMN_NONEWMAILPARAM,*PYAMN_NONEWMAILPARAM;
diff --git a/protocols/YAMN/src/browser/mailbrowser.cpp b/protocols/YAMN/src/browser/mailbrowser.cpp
index 80b379d2f2..55d6ef9655 100644
--- a/protocols/YAMN/src/browser/mailbrowser.cpp
+++ b/protocols/YAMN/src/browser/mailbrowser.cpp
@@ -71,8 +71,8 @@ struct CMailWinUserInfo
struct CChangeContent
{
- DWORD nflags;
- DWORD nnflags;
+ uint32_t nflags;
+ uint32_t nnflags;
};
struct CUpdateMails
@@ -111,7 +111,7 @@ enum
// nflags- flags what to do when new mail arrives
// nnflags- flags what to do when no new mail arrives
// returns one of UPDATE_XXX value(not implemented yet)
-int UpdateMails(HWND hDlg, CAccount *ActualAccount, DWORD nflags, DWORD nnflags);
+int UpdateMails(HWND hDlg, CAccount *ActualAccount, uint32_t nflags, uint32_t nnflags);
// When new mail occurs, shows window, plays sound, runs application...
// hDlg- dialog handle. Dialog of mailbrowser is already created and actions are performed over this window
@@ -120,7 +120,7 @@ int UpdateMails(HWND hDlg, CAccount *ActualAccount, DWORD nflags, DWORD nnflags)
// nflags- what to do or not to do (e.g. to show mailbrowser window or prohibit to show)
// nflags- flags what to do when new mail arrives
// nnflags- flags what to do when no new mail arrives
-void DoMailActions(HWND hDlg, CAccount *ActualAccount, struct CMailNumbers *MN, DWORD nflags, DWORD nnflags);
+void DoMailActions(HWND hDlg, CAccount *ActualAccount, struct CMailNumbers *MN, uint32_t nflags, uint32_t nnflags);
// Looks for items in mailbrowser and if they were deleted, delete them from browser window
// hListView- handle of listview window
@@ -136,7 +136,7 @@ int ChangeExistingMailStatus(HWND hListView, CAccount *ActualAccount);
// MailNumbers- pointer to structure, in which function stores numbers of mails with some property
// nflags- flags what to do when new mail arrives
// returns one of UPDATE_XXX value (not implemented yet)
-int AddNewMailsToListView(HWND hListView, CAccount *ActualAccount, DWORD nflags);
+int AddNewMailsToListView(HWND hListView, CAccount *ActualAccount, uint32_t nflags);
// Window callback procedure for popup window (created by popup plugin)
LRESULT CALLBACK NewMailPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -190,7 +190,7 @@ typedef struct _LVCOMPAREINFO
//--------------------------------------------------------------------------------------------------
-LPARAM readItemLParam(HWND hwnd, DWORD iItem)
+LPARAM readItemLParam(HWND hwnd, uint32_t iItem)
{
LVITEM item;
item.mask = LVIF_PARAM;
@@ -311,7 +311,7 @@ void IncrementMailCounters(HYAMNMAIL msgq, struct CMailNumbers *MN)
MN->Real.EventNC++;
}
-int UpdateMails(HWND hDlg, CAccount *ActualAccount, DWORD nflags, DWORD nnflags)
+int UpdateMails(HWND hDlg, CAccount *ActualAccount, uint32_t nflags, uint32_t nnflags)
{
struct CMailNumbers MN;
@@ -471,7 +471,7 @@ int ChangeExistingMailStatus(HWND hListView, CAccount *ActualAccount)
}
void MimeDateToLocalizedDateTime(char *datein, wchar_t *dateout, int lendateout);
-int AddNewMailsToListView(HWND hListView, CAccount *ActualAccount, DWORD nflags)
+int AddNewMailsToListView(HWND hListView, CAccount *ActualAccount, uint32_t nflags)
{
wchar_t *FromStr;
wchar_t SizeStr[20];
@@ -620,7 +620,7 @@ int AddNewMailsToListView(HWND hListView, CAccount *ActualAccount, DWORD nflags)
return TRUE;
}
-void DoMailActions(HWND hDlg, CAccount *ActualAccount, struct CMailNumbers *MN, DWORD nflags, DWORD nnflags)
+void DoMailActions(HWND hDlg, CAccount *ActualAccount, struct CMailNumbers *MN, uint32_t nflags, uint32_t nnflags)
{
NOTIFYICONDATA nid = {};
nid.cbSize = sizeof(nid);
@@ -1064,7 +1064,7 @@ ULONGLONG MimeDateToFileTime(char *datein)
FILETIME ft;
if (SystemTimeToFileTime(&st, &ft)) {
res = ((ULONGLONG)ft.dwHighDateTime << 32) | ((ULONGLONG)ft.dwLowDateTime);
- LONGLONG w100nano = Int32x32To64((DWORD)wShiftSeconds, 10000000);
+ LONGLONG w100nano = Int32x32To64((uint32_t)wShiftSeconds, 10000000);
res -= w100nano;
}
else {
@@ -1093,8 +1093,8 @@ void FileTimeToLocalizedDateTime(LONGLONG filetime, wchar_t *dateout, int lendat
wTodayMonth = st.wMonth;
wTodayDay = st.wDay;
}
- ft.dwLowDateTime = (DWORD)filetime;
- ft.dwHighDateTime = (DWORD)(filetime >> 32);
+ ft.dwLowDateTime = (uint32_t)filetime;
+ ft.dwHighDateTime = (uint32_t)(filetime >> 32);
FILETIME localft;
if (!FileTimeToLocalFileTime(&ft, &localft)) {
// this should never happen
@@ -1246,7 +1246,7 @@ static LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
return mir_callNextSubclass(hwnd, SplitterSubclassProc, msg, wParam, lParam);
}
-void ConvertCodedStringToUnicode(char *stream, wchar_t **storeto, DWORD cp, int mode);
+void ConvertCodedStringToUnicode(char *stream, wchar_t **storeto, uint32_t cp, int mode);
int ConvertStringToUnicode(char *stream, unsigned int cp, wchar_t **out);
INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -1834,7 +1834,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
case WM_YAMN_UPDATEMAILS:
{
struct CUpdateMails *um = (struct CUpdateMails *)lParam;
- DWORD nflags, nnflags;
+ uint32_t nflags, nnflags;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "MailBrowser:UPDATEMAILS\n");
@@ -1983,7 +1983,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
case IDC_BTNDEL:
{
HYAMNMAIL ActualMail;
- DWORD Total = 0;
+ uint32_t Total = 0;
// we use event to signal, that running thread has all needed stack parameters copied
HANDLE ThreadRunningEV = CreateEvent(nullptr, FALSE, FALSE, nullptr);
@@ -2353,7 +2353,7 @@ INT_PTR RunMailBrowserSvc(WPARAM wParam, LPARAM lParam)
{
PYAMN_MAILBROWSERPARAM Param = (PYAMN_MAILBROWSERPARAM)wParam;
- if ((DWORD)lParam != YAMN_MAILBROWSERVERSION)
+ if ((uint32_t)lParam != YAMN_MAILBROWSERVERSION)
return 0;
//an event for successfull copy parameters to which point a pointer in stack for new thread
diff --git a/protocols/YAMN/src/debug.cpp b/protocols/YAMN/src/debug.cpp
index 2f5c1d4761..3ed7507c40 100644
--- a/protocols/YAMN/src/debug.cpp
+++ b/protocols/YAMN/src/debug.cpp
@@ -97,8 +97,8 @@ void DebugLog(HANDLE File,const char *fmt,...)
str=(char *)realloc(str,strsize+=65536);
va_end(vararg);
EnterCriticalSection(&FileAccessCS);
- WriteFile(File,tids,(DWORD)mir_strlen(tids),&Written,nullptr);
- WriteFile(File,str,(DWORD)mir_strlen(str),&Written,nullptr);
+ WriteFile(File,tids,(uint32_t)mir_strlen(tids),&Written,nullptr);
+ WriteFile(File,str,(uint32_t)mir_strlen(str),&Written,nullptr);
LeaveCriticalSection(&FileAccessCS);
free(str);
}
@@ -118,8 +118,8 @@ void DebugLogW(HANDLE File,const wchar_t *fmt,...)
str=(wchar_t *)realloc(str,(strsize+=65536)*sizeof(wchar_t));
va_end(vararg);
EnterCriticalSection(&FileAccessCS);
- WriteFile(File,tids,(DWORD)mir_strlen(tids),&Written,nullptr);
- WriteFile(File,str,(DWORD)mir_wstrlen(str)*sizeof(wchar_t),&Written,nullptr);
+ WriteFile(File,tids,(uint32_t)mir_strlen(tids),&Written,nullptr);
+ WriteFile(File,str,(uint32_t)mir_wstrlen(str)*sizeof(wchar_t),&Written,nullptr);
LeaveCriticalSection(&FileAccessCS);
free(str);
}
diff --git a/protocols/YAMN/src/debug.h b/protocols/YAMN/src/debug.h
index f0405d7453..0da7d79574 100644
--- a/protocols/YAMN/src/debug.h
+++ b/protocols/YAMN/src/debug.h
@@ -31,14 +31,14 @@ extern HANDLE DecodeFile;
#endif
#if defined(DEBUG_FILEREAD) || defined(DEBUG_FILEREADMESSAGES)
-DWORD ReadStringFromMemory(char **Parser,char *End,char **StoreTo,char *DebugString);
+uint32_t ReadStringFromMemory(char **Parser,char *End,char **StoreTo,char *DebugString);
-DWORD ReadStringFromMemoryW(char **Parser,wchar_t *End,char **StoreTo,wchar_t *DebugString);
+uint32_t ReadStringFromMemoryW(char **Parser,wchar_t *End,char **StoreTo,wchar_t *DebugString);
#else
-DWORD ReadStringFromMemory(char **Parser,char *End,char **StoreTo);
+uint32_t ReadStringFromMemory(char **Parser,char *End,char **StoreTo);
-DWORD ReadStringFromMemoryW(wchar_t **Parser,wchar_t *End,wchar_t **StoreTo);
+uint32_t ReadStringFromMemoryW(wchar_t **Parser,wchar_t *End,wchar_t **StoreTo);
#endif
diff --git a/protocols/YAMN/src/filterplugin.cpp b/protocols/YAMN/src/filterplugin.cpp
index 35d18bf75c..c3660415e6 100644
--- a/protocols/YAMN/src/filterplugin.cpp
+++ b/protocols/YAMN/src/filterplugin.cpp
@@ -29,7 +29,7 @@ INT_PTR FilterMailSvc(WPARAM,LPARAM);
// YAMNFilterFcn- pointer to imported functions
// YAMNfilterFcnVer- version of YAMN_FILTERIMPORTFCN, use YAMN_FILTERIMPORTFCNVERSION
// returns nonzero if success
-int WINAPI SetFilterPluginFcnImportFcn(HYAMNFILTERPLUGIN Plugin,DWORD Importance,PYAMN_FILTERIMPORTFCN YAMNFilterFcn,DWORD YAMNFilterFcnVer);
+int WINAPI SetFilterPluginFcnImportFcn(HYAMNFILTERPLUGIN Plugin,uint32_t Importance,PYAMN_FILTERIMPORTFCN YAMNFilterFcn,uint32_t YAMNFilterFcnVer);
struct CExportedFunctions FilterPluginExportedFcn[]=
{
@@ -122,7 +122,7 @@ INT_PTR UnregisterFilterPlugins()
return 1;
}
-int WINAPI SetFilterPluginFcnImportFcn(HYAMNFILTERPLUGIN Plugin,DWORD Importance,PYAMN_FILTERIMPORTFCN YAMNFilterFcn,DWORD YAMNFilterFcnVer)
+int WINAPI SetFilterPluginFcnImportFcn(HYAMNFILTERPLUGIN Plugin,uint32_t Importance,PYAMN_FILTERIMPORTFCN YAMNFilterFcn,uint32_t YAMNFilterFcnVer)
{
PYAMN_FILTERPLUGINQUEUE Parser,Previous;
diff --git a/protocols/YAMN/src/mails/decode.cpp b/protocols/YAMN/src/mails/decode.cpp
index 39e04a0ba9..e0070658eb 100644
--- a/protocols/YAMN/src/mails/decode.cpp
+++ b/protocols/YAMN/src/mails/decode.cpp
@@ -198,7 +198,7 @@ int ConvertStringToUnicode(char *stream,unsigned int cp,wchar_t **out);
// cp- codepage of input string
// storeto- pointer to memory that contains unicode string
// mode- MIME_PLAIN or MIME_MAIL (MIME_MAIL deletes '"' from start and end of string)
-void ConvertCodedStringToUnicode(char *stream,wchar_t **storeto,DWORD cp,int mode);
+void ConvertCodedStringToUnicode(char *stream,wchar_t **storeto,uint32_t cp,int mode);
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
@@ -390,7 +390,7 @@ int ConvertStringToUnicode(char *stream,unsigned int cp,wchar_t **out)
int streamlen,Index;
//codepages, which require to have set 0 in dwFlags parameter when calling MultiByteToWideChar
- DWORD CodePagesZeroFlags[]={50220,50221,50222,50225,50227,50229,52936,54936,57002,57003,57004,57005,57006,57007,57008,57009,57010,57011,65000,65001};
+ uint32_t CodePagesZeroFlags[]={50220,50221,50222,50225,50227,50229,52936,54936,57002,57003,57004,57005,57006,57007,57008,57009,57010,57011,65000,65001};
if ((cp != CP_ACP) && (cp != CP_OEMCP) && (cp != CP_MACCP) && (cp != CP_THREAD_ACP) && (cp != CP_SYMBOL) && (cp != CP_UTF7) && (cp != CP_UTF8) && !GetCPInfo(cp,&CPInfo))
cp=CP_ACP;
@@ -439,7 +439,7 @@ int ConvertStringToUnicode(char *stream,unsigned int cp,wchar_t **out)
return 1;
}
-void ConvertCodedStringToUnicode(char *stream,wchar_t **storeto,DWORD cp,int mode)
+void ConvertCodedStringToUnicode(char *stream,wchar_t **storeto,uint32_t cp,int mode)
{
char *start=stream,*finder,*finderend;
char Encoding=0;
@@ -472,7 +472,7 @@ void ConvertCodedStringToUnicode(char *stream,wchar_t **storeto,DWORD cp,int mod
default:
goto NotEncoded;
}
- if (-1==(cp=(DWORD)GetCharsetFromString(finder,finderend-finder)))
+ if (-1==(cp=(uint32_t)GetCharsetFromString(finder,finderend-finder)))
cp=CP_ACP;
if (Encoding != 0)
{
diff --git a/protocols/YAMN/src/mails/mails.cpp b/protocols/YAMN/src/mails/mails.cpp
index 7345a46dfc..d0dbba76ab 100644
--- a/protocols/YAMN/src/mails/mails.cpp
+++ b/protocols/YAMN/src/mails/mails.cpp
@@ -89,7 +89,7 @@ HYAMNMAIL WINAPI CreateNewDeleteQueueFcn(HYAMNMAIL From);
// FlagsNotSet- ...and must not have set these flags...
// FlagsToSetRemove- ...to set/remove these flags (see mode)
// mode- nonzero to set, else remove
-void WINAPI SetRemoveFlagsInQueueFcn(HYAMNMAIL From,DWORD FlagsSet,DWORD FlagsNotSet,DWORD FlagsToSetRemove,int mode);
+void WINAPI SetRemoveFlagsInQueueFcn(HYAMNMAIL From,uint32_t FlagsSet,uint32_t FlagsNotSet,uint32_t FlagsToSetRemove,int mode);
struct CExportedFunctions MailExportedFcn[]=
{
@@ -119,7 +119,7 @@ struct CExportedServices MailExportedSvc[]=
INT_PTR CreateAccountMailSvc(WPARAM wParam,LPARAM lParam)
{
CAccount *Account=(CAccount *)wParam;
- DWORD MailVersion=(DWORD)lParam;
+ uint32_t MailVersion=(uint32_t)lParam;
HYAMNMAIL NewMail;
//test if we are going to initialize members of suitable structure (structures of plugin and YAMN must match)
@@ -194,7 +194,7 @@ void WINAPI AppendQueueFcn(HYAMNMAIL first,HYAMNMAIL second)
INT_PTR LoadMailDataSvc(WPARAM wParam,LPARAM lParam)
{
HYAMNMAIL Mail=(HYAMNMAIL)wParam;
- DWORD MailVersion=(DWORD)lParam;
+ uint32_t MailVersion=(uint32_t)lParam;
if (MailVersion != YAMN_MAILDATAVERSION)
return NULL;
@@ -210,7 +210,7 @@ INT_PTR UnloadMailDataSvc(WPARAM, LPARAM)
INT_PTR SaveMailDataSvc(WPARAM, LPARAM lParam)
{
- DWORD MailVersion=(DWORD)lParam;
+ uint32_t MailVersion=(uint32_t)lParam;
if (MailVersion != YAMN_MAILDATAVERSION)
return (INT_PTR)-1;
@@ -324,7 +324,7 @@ void WINAPI DeleteMessagesToEndFcn(CAccount *Account,HYAMNMAIL From)
void WINAPI DeleteMessageFromQueueFcn(HYAMNMAIL *From,HYAMNMAIL Which,int mode=0)
{
- DWORD Number=Which->Number;
+ uint32_t Number=Which->Number;
HYAMNMAIL Parser;
if (*From==Which)
@@ -477,7 +477,7 @@ HYAMNMAIL WINAPI CreateNewDeleteQueueFcn(HYAMNMAIL From)
return FirstMail;
}
-void WINAPI SetRemoveFlagsInQueueFcn(HYAMNMAIL From,DWORD FlagsSet,DWORD FlagsNotSet,DWORD FlagsToSetRemove,int mode)
+void WINAPI SetRemoveFlagsInQueueFcn(HYAMNMAIL From,uint32_t FlagsSet,uint32_t FlagsNotSet,uint32_t FlagsToSetRemove,int mode)
{
HYAMNMAIL msgq;
diff --git a/protocols/YAMN/src/proto/netclient.h b/protocols/YAMN/src/proto/netclient.h
index dff43ae0f1..920c48fbc0 100644
--- a/protocols/YAMN/src/proto/netclient.h
+++ b/protocols/YAMN/src/proto/netclient.h
@@ -16,8 +16,8 @@ public:
BOOL Stopped;
int Rcv;
- DWORD NetworkError;
- DWORD SystemError;
+ uint32_t NetworkError;
+ uint32_t SystemError;
BOOL ifTLSed;
};
diff --git a/protocols/YAMN/src/proto/netlib.cpp b/protocols/YAMN/src/proto/netlib.cpp
index 507b9b4051..54a40ba4cd 100644
--- a/protocols/YAMN/src/proto/netlib.cpp
+++ b/protocols/YAMN/src/proto/netlib.cpp
@@ -78,7 +78,7 @@ void CNLClient::SSLify() throw(DWORD)
}
//ssl could not be created
- throw NetworkError = (DWORD)ESSL_CREATESSL;
+ throw NetworkError = (uint32_t)ESSL_CREATESSL;
}
//Connects to the server through the sock
@@ -97,7 +97,7 @@ void CNLClient::Connect(const char* servername, const int port) throw(DWORD)
nloc.wPort = port;
if (nullptr == (hConnection = Netlib_OpenConnection(hNetlibUser, &nloc))) {
SystemError = WSAGetLastError();
- throw NetworkError = (DWORD)ENL_CONNECT;
+ throw NetworkError = (uint32_t)ENL_CONNECT;
}
#ifdef DEBUG_COMM
DebugLog(CommFile, "</connect>\n");
@@ -133,7 +133,7 @@ void CNLClient::Send(const char *query) throw(DWORD)
try {
if ((SOCKET_ERROR == (Sent = LocalNetlib_Send(hConnection, query, (int)mir_strlen(query), MSG_DUMPASTEXT))) || Sent != (unsigned int)mir_strlen(query)) {
SystemError = WSAGetLastError();
- throw NetworkError = (DWORD)ENL_SEND;
+ throw NetworkError = (uint32_t)ENL_SEND;
}
#ifdef DEBUG_COMM
DebugLog(CommFile, "</send>\n");
@@ -175,7 +175,7 @@ char* CNLClient::Recv(char *buf, int buflen) throw(DWORD)
if (buf == nullptr)
buf = (char *)malloc(sizeof(char)*(buflen + 1));
if (buf == nullptr)
- throw NetworkError = (DWORD)ENL_RECVALLOC;
+ throw NetworkError = (uint32_t)ENL_RECVALLOC;
if (!isTLSed) {
NETLIBSELECT nls = {};
@@ -185,10 +185,10 @@ char* CNLClient::Recv(char *buf, int buflen) throw(DWORD)
case SOCKET_ERROR:
free(buf);
SystemError = WSAGetLastError();
- throw NetworkError = (DWORD)ENL_RECV;
+ throw NetworkError = (uint32_t)ENL_RECV;
case 0: // time out!
free(buf);
- throw NetworkError = (DWORD)ENL_TIMEOUT;
+ throw NetworkError = (uint32_t)ENL_TIMEOUT;
}
}
@@ -196,12 +196,12 @@ char* CNLClient::Recv(char *buf, int buflen) throw(DWORD)
if (SOCKET_ERROR == (Rcv = LocalNetlib_Recv(hConnection, buf, buflen, MSG_DUMPASTEXT))) {
free(buf);
SystemError = WSAGetLastError();
- throw NetworkError = (DWORD)ENL_RECV;
+ throw NetworkError = (uint32_t)ENL_RECV;
}
if (!Rcv) {
free(buf);
SystemError = WSAGetLastError();
- throw NetworkError = (DWORD)ENL_RECV;
+ throw NetworkError = (uint32_t)ENL_RECV;
}
#ifdef DEBUG_COMM
*(buf + Rcv) = 0; //end the buffer to write it to file
diff --git a/protocols/YAMN/src/proto/pop3/pop3.cpp b/protocols/YAMN/src/proto/pop3/pop3.cpp
index d263d332e4..a90eccd90f 100644
--- a/protocols/YAMN/src/proto/pop3/pop3.cpp
+++ b/protocols/YAMN/src/proto/pop3/pop3.cpp
@@ -35,7 +35,7 @@
char *CPop3Client::Connect(const char* servername,const int port,BOOL UseSSL, BOOL NoTLS)
{
if (Stopped) // check if we can work with this POP3 client session
- throw POP3Error = (DWORD)EPOP3_STOPPED;
+ throw POP3Error = (uint32_t)EPOP3_STOPPED;
delete NetClient;
SSL = UseSSL;
@@ -62,7 +62,7 @@ char *CPop3Client::Connect(const char* servername,const int port,BOOL UseSSL, BO
extern BOOL SSLLoaded;
if (!NoTLS & !(SSL)) {
if (NetClient->Stopped) //check if we can work with this POP3 client session
- throw POP3Error = (DWORD)EPOP3_STOPPED;
+ throw POP3Error = (uint32_t)EPOP3_STOPPED;
NetClient->Send("STLS\r\n");
free(temp);
temp = RecvRest(NetClient->Recv(), POP3_SEARCHACK);
@@ -105,7 +105,7 @@ char* CPop3Client::RecvRest(char* prev,int mode,int size)
{
if (PrevString != nullptr)
free(PrevString);
- throw POP3Error=(DWORD)EPOP3_STOPPED;
+ throw POP3Error=(uint32_t)EPOP3_STOPPED;
}
if (SizeLeft==0) //if block is full
{
@@ -114,7 +114,7 @@ char* CPop3Client::RecvRest(char* prev,int mode,int size)
LastString=NetClient->Recv(nullptr,SizeLeft);
PrevString=(char *)realloc(PrevString,sizeof(char)*(SizeRead+size));
if (PrevString==nullptr)
- throw POP3Error=(DWORD)EPOP3_RESTALLOC;
+ throw POP3Error=(uint32_t)EPOP3_RESTALLOC;
memcpy(PrevString+SizeRead,LastString,size);
free(LastString);
}
@@ -188,7 +188,7 @@ BOOL CPop3Client::SearchFromStart(char *start,int bs,int mode)
char* CPop3Client::User(char* name)
{
if (NetClient->Stopped) // check if we can work with this POP3 client session
- throw POP3Error = (DWORD)EPOP3_STOPPED;
+ throw POP3Error = (uint32_t)EPOP3_STOPPED;
char query[128];
char *Result;
@@ -197,7 +197,7 @@ char* CPop3Client::User(char* name)
NetClient->Send(query);
Result = RecvRest(NetClient->Recv(), POP3_SEARCHACK);
if (AckFlag == POP3_FERR)
- throw POP3Error = (DWORD)EPOP3_BADUSER;
+ throw POP3Error = (uint32_t)EPOP3_BADUSER;
POP3Error = 0;
return Result;
}
@@ -207,7 +207,7 @@ char* CPop3Client::User(char* name)
char* CPop3Client::Pass(char* pw)
{
if (NetClient->Stopped) //check if we can work with this POP3 client session
- throw POP3Error = (DWORD)EPOP3_STOPPED;
+ throw POP3Error = (uint32_t)EPOP3_STOPPED;
char query[128];
mir_snprintf(query, "PASS %s\r\n", pw);
@@ -215,7 +215,7 @@ char* CPop3Client::Pass(char* pw)
char *Result = RecvRest(NetClient->Recv(), POP3_SEARCHACK);
if (AckFlag == POP3_FERR)
- throw POP3Error = (DWORD)EPOP3_BADPASS;
+ throw POP3Error = (uint32_t)EPOP3_BADPASS;
return Result;
}
@@ -224,14 +224,14 @@ char* CPop3Client::Pass(char* pw)
char* CPop3Client::APOP(char* name, char* pw, char* timestamp)
{
if (NetClient->Stopped) // check if we can work with this POP3 client session
- throw POP3Error = (DWORD)EPOP3_STOPPED;
+ throw POP3Error = (uint32_t)EPOP3_STOPPED;
char query[512];
char *Result;
unsigned char digest[16];
if (timestamp == nullptr)
- throw POP3Error = (DWORD)EPOP3_APOP;
+ throw POP3Error = (uint32_t)EPOP3_APOP;
mir_md5_state_s ctx;
mir_md5_init(&ctx);
mir_md5_append(&ctx, (const unsigned char *)timestamp, (unsigned int)mir_strlen(timestamp));
@@ -244,7 +244,7 @@ char* CPop3Client::APOP(char* name, char* pw, char* timestamp)
NetClient->Send(query);
Result = RecvRest(NetClient->Recv(), POP3_SEARCHACK);
if (AckFlag == POP3_FERR)
- throw POP3Error = (DWORD)EPOP3_BADUSER;
+ throw POP3Error = (uint32_t)EPOP3_BADUSER;
return Result;
}
@@ -263,7 +263,7 @@ char* CPop3Client::Quit()
char* CPop3Client::Stat()
{
if (NetClient->Stopped) //check if we can work with this POP3 client session
- throw POP3Error = (DWORD)EPOP3_STOPPED;
+ throw POP3Error = (uint32_t)EPOP3_STOPPED;
char query[] = "STAT\r\n";
NetClient->Send(query);
@@ -275,7 +275,7 @@ char* CPop3Client::Stat()
char* CPop3Client::List()
{
if (NetClient->Stopped) // check if we can work with this POP3 client session
- throw POP3Error = (DWORD)EPOP3_STOPPED;
+ throw POP3Error = (uint32_t)EPOP3_STOPPED;
char query[] = "LIST\r\n";
@@ -288,7 +288,7 @@ char* CPop3Client::List()
char* CPop3Client::Top(int nr, int lines)
{
if (NetClient->Stopped) // check if we can work with this POP3 client session
- throw POP3Error=(DWORD)EPOP3_STOPPED;
+ throw POP3Error=(uint32_t)EPOP3_STOPPED;
char query[128];
@@ -302,7 +302,7 @@ char* CPop3Client::Top(int nr, int lines)
char* CPop3Client::Uidl(int nr)
{
if (NetClient->Stopped) // check if we can work with this POP3 client session
- throw POP3Error = (DWORD)EPOP3_STOPPED;
+ throw POP3Error = (uint32_t)EPOP3_STOPPED;
char query[128];
if (nr) {
@@ -320,7 +320,7 @@ char* CPop3Client::Uidl(int nr)
char* CPop3Client::Dele(int nr)
{
if (NetClient->Stopped) // check if we can work with this POP3 client session
- throw POP3Error = (DWORD)EPOP3_STOPPED;
+ throw POP3Error = (uint32_t)EPOP3_STOPPED;
char query[128];
@@ -334,7 +334,7 @@ char* CPop3Client::Dele(int nr)
char* CPop3Client::Retr(int nr)
{
if (NetClient->Stopped) // check if we can work with this POP3 client session
- throw POP3Error = (DWORD)EPOP3_STOPPED;
+ throw POP3Error = (uint32_t)EPOP3_STOPPED;
char query[128];
mir_snprintf(query, "RETR %d\r\n", nr);
diff --git a/protocols/YAMN/src/proto/pop3/pop3.h b/protocols/YAMN/src/proto/pop3/pop3.h
index 1005f3a47b..963a584d30 100644
--- a/protocols/YAMN/src/proto/pop3/pop3.h
+++ b/protocols/YAMN/src/proto/pop3/pop3.h
@@ -39,7 +39,7 @@ public:
BOOL SSL;
BOOL Stopped;
- DWORD POP3Error;
+ uint32_t POP3Error;
class CNetClient *NetClient; //here the network layout is defined (TCP or SSL+TCP etc.)
private:
BOOL SearchFromEnd(char *end,int bs,int mode);
diff --git a/protocols/YAMN/src/proto/pop3/pop3comm.cpp b/protocols/YAMN/src/proto/pop3/pop3comm.cpp
index bd6b72bd11..fbb89eaa78 100644
--- a/protocols/YAMN/src/proto/pop3/pop3comm.cpp
+++ b/protocols/YAMN/src/proto/pop3/pop3comm.cpp
@@ -48,7 +48,7 @@ HYAMNMAIL WINAPI CreatePOP3Mail(CAccount *Account, DWORD CMimeMailVersion);
//Function does all needed work when connection failed or any error occured
//Creates structure containing error code, closes internet session, runs "bad connect" function
-static void PostErrorProc(HPOP3ACCOUNT ActualAccount, void *ParamToBadConnect, DWORD POP3PluginParam, BOOL UseSSL);
+static void PostErrorProc(HPOP3ACCOUNT ActualAccount, void *ParamToBadConnect, uint32_t POP3PluginParam, BOOL UseSSL);
//Checks POP3 account and stores all info to account. It deletes old mails=> synchro
// WhichTemp- pointer to strucure containing needed information
@@ -338,7 +338,7 @@ DWORD WINAPI UnLoadPOP3(void *)
DWORD WINAPI WritePOP3Accounts()
{
- DWORD ReturnValue = CallService(MS_YAMN_WRITEACCOUNTS, (WPARAM)POP3Plugin, (LPARAM)FileName);
+ uint32_t ReturnValue = CallService(MS_YAMN_WRITEACCOUNTS, (WPARAM)POP3Plugin, (LPARAM)FileName);
if (ReturnValue == EACC_SYSTEM) {
wchar_t temp[1024] = { 0 };
mir_snwprintf(temp, L"%s\n%s", TranslateT("Error while copying data to disk occurred. Is file in use?"), FileName);
@@ -351,9 +351,9 @@ DWORD WINAPI WritePOP3Accounts()
DWORD WINAPI WritePOP3Options(HANDLE File, CAccount *Which)
{
DWORD WrittenBytes;
- DWORD Ver = POP3_FILEVERSION;
+ uint32_t Ver = POP3_FILEVERSION;
- if ((!WriteFile(File, (char *)&Ver, sizeof(DWORD), &WrittenBytes, nullptr)) ||
+ if ((!WriteFile(File, (char *)&Ver, sizeof(uint32_t), &WrittenBytes, nullptr)) ||
(!WriteFile(File, (char *)&((HPOP3ACCOUNT)Which)->CP, sizeof(uint16_t), &WrittenBytes, nullptr)))
return EACC_SYSTEM;
return 0;
@@ -361,12 +361,12 @@ DWORD WINAPI WritePOP3Options(HANDLE File, CAccount *Which)
DWORD WINAPI ReadPOP3Options(CAccount *Which, char **Parser, char *End)
{
- DWORD Ver;
+ uint32_t Ver;
#ifdef DEBUG_FILEREAD
wchar_t Debug[256];
#endif
- Ver = *(DWORD *)(*Parser);
- (*Parser) += sizeof(DWORD);
+ Ver = *(uint32_t *)(*Parser);
+ (*Parser) += sizeof(uint32_t);
if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
if (Ver != POP3_FILEVERSION)
@@ -411,7 +411,7 @@ static void SetContactStatus(CAccount *account, int status)
g_plugin.setWord(account->hContact, "Status", status);
}
-static void PostErrorProc(HPOP3ACCOUNT ActualAccount, void *ParamToBadConnection, DWORD POP3PluginParam, BOOL UseSSL)
+static void PostErrorProc(HPOP3ACCOUNT ActualAccount, void *ParamToBadConnection, uint32_t POP3PluginParam, BOOL UseSSL)
{
char *DataRX;
@@ -430,7 +430,7 @@ static void PostErrorProc(HPOP3ACCOUNT ActualAccount, void *ParamToBadConnection
ErrorCode->SystemError = ActualAccount->Client.NetClient->SystemError;
}
- if (POP3PluginParam == (DWORD)NULL) //if it was normal YAMN call (force check or so on)
+ if (POP3PluginParam == (uint32_t)NULL) //if it was normal YAMN call (force check or so on)
{
try
{
@@ -469,7 +469,7 @@ static void PostErrorProc(HPOP3ACCOUNT ActualAccount, void *ParamToBadConnection
CallService(MS_YAMN_BADCONNECTION, (WPARAM)&cp, (LPARAM)YAMN_BADCONNECTIONVERSION);
}
- if (POP3PluginParam == (DWORD)NULL) //if it was normal YAMN call
+ if (POP3PluginParam == (uint32_t)NULL) //if it was normal YAMN call
SetEvent(ActualAccount->UseInternetFree);
}
@@ -483,16 +483,16 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
int mboxsize, msgs, i;
SYSTEMTIME now;
LPVOID YAMNParam;
- DWORD CheckFlags;
+ uint32_t CheckFlags;
BOOL UsingInternet = FALSE;
struct {
char *ServerName;
- DWORD ServerPort;
+ uint32_t ServerPort;
char *ServerLogin;
char *ServerPasswd;
- DWORD Flags;
- DWORD NFlags;
- DWORD NNFlags;
+ uint32_t Flags;
+ uint32_t NFlags;
+ uint32_t NNFlags;
} ActualCopied;
//First, we should compare our version of CheckParam structure, but here it is not needed, because YAMN and internal plugin
@@ -500,7 +500,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
// if (((struct CheckParam *)WhichTemp)->Ver != YAMN_CHECKVERSION)
// {
// SetEvent(((struct CheckParam *)WhichTemp)->ThreadRunningEV); //don't forget to unblock YAMN
- // return (DWORD)-1; //ok, but we should return value.
+ // return (uint32_t)-1; //ok, but we should return value.
// //When our plugin returns e.g. 0xFFFFFFFF (=-1, this is only our plugin value, YAMN does nothing with return value,
// //but only tests if it is nonzero. If yes, it calls GetErrorStringFcn. We know problem occured in YAMN incompatibility
// //and then we can in our GetErrorStringFcn e.g. return string "Uncompatible version of YAMN".
@@ -660,7 +660,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
if (MsgQueuePtr == nullptr)
{
ActualAccount->SystemError = EPOP3_QUEUEALLOC;
- throw (DWORD)ActualAccount->SystemError;
+ throw (uint32_t)ActualAccount->SystemError;
}
}
@@ -698,7 +698,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"CheckPOP3:ActualAccountMsgsSO-write wait failed\n");
#endif
- throw (DWORD)(ActualAccount->SystemError = EACC_STOPPED);
+ throw (uint32_t)(ActualAccount->SystemError = EACC_STOPPED);
}
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"CheckPOP3:ActualAccountMsgsSO-write enter\n");
@@ -838,7 +838,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"CheckPOP3:ActualAccountMsgsSO-write wait failed\n");
#endif
- throw (DWORD)ActualAccount->SystemError == EACC_STOPPED;
+ throw (uint32_t)ActualAccount->SystemError == EACC_STOPPED;
}
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"CheckPOP3:ActualAccountMsgsSO-write enter\n");
@@ -901,9 +901,9 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
SetContactStatus(ActualAccount, ActualAccount->isCounting ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE);
}
#ifdef DEBUG_COMM
- catch(DWORD ErrorCode)
+ catch(uint32_t ErrorCode)
#else
- catch (DWORD)
+ catch (uint32_t)
#endif
{
if (ActualAccount->Client.POP3Error == EPOP3_STOPPED)
@@ -942,7 +942,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp)
ActualAccount->Client.NetClient->Disconnect();
break;
default:
- PostErrorProc(ActualAccount, YAMNParam, (DWORD)NULL, MyClient->SSL); //it closes internet connection too
+ PostErrorProc(ActualAccount, YAMNParam, (uint32_t)NULL, MyClient->SSL); //it closes internet connection too
}
if (UsingInternet) //if our thread still uses internet
@@ -979,12 +979,12 @@ void __cdecl DeleteMailsPOP3(void *param)
BOOL UsingInternet = FALSE;
struct {
char *ServerName;
- DWORD ServerPort;
+ uint32_t ServerPort;
char *ServerLogin;
char *ServerPasswd;
- DWORD Flags;
- DWORD NFlags;
- DWORD NNFlags;
+ uint32_t Flags;
+ uint32_t NFlags;
+ uint32_t NNFlags;
} ActualCopied;
//First, we should compare our version of DeleteParam structure, but here it is not needed, because YAMN and internal plugin
@@ -992,7 +992,7 @@ void __cdecl DeleteMailsPOP3(void *param)
// if (((struct DeleteParam *)WhichTemp)->Ver != YAMN_DELETEVERSION)
// {
// SetEvent(((struct DeleteParam *)WhichTemp)->ThreadRunningEV); //don't forget to unblock YAMN
- // return (DWORD)-1; //ok, but we should return value.
+ // return (uint32_t)-1; //ok, but we should return value.
// //When our plugin returns e.g. 0xFFFFFFFF (this is only our plugin value, YAMN does nothing with return value,
// //but only tests if it is nonzero. If yes, it calls GetErrorStringFcn), we know problem occured in YAMN incompatibility
// //and then we can in our GetErrorStringFcn e.g. return string "Uncompatible version of YAMN".
@@ -1156,7 +1156,7 @@ void __cdecl DeleteMailsPOP3(void *param)
if (MsgQueuePtr == nullptr)
{
ActualAccount->SystemError = EPOP3_QUEUEALLOC;
- throw (DWORD)ActualAccount->SystemError;
+ throw (uint32_t)ActualAccount->SystemError;
}
}
@@ -1188,7 +1188,7 @@ void __cdecl DeleteMailsPOP3(void *param)
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"DeleteMailsPOP3:ActualAccountMsgsSO-write wait failed\n");
#endif
- throw (DWORD)EACC_STOPPED;
+ throw (uint32_t)EACC_STOPPED;
}
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"DeleteMailsPOP3:ActualAccountMsgsSO-write enter\n");
@@ -1302,9 +1302,9 @@ void __cdecl DeleteMailsPOP3(void *param)
SetContactStatus(ActualAccount, ActualAccount->isCounting ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE);
}
#ifdef DEBUG_COMM
- catch(DWORD ErrorCode)
+ catch(uint32_t ErrorCode)
#else
- catch (DWORD)
+ catch (uint32_t)
#endif
{
if (ActualAccount->Client.POP3Error == EPOP3_STOPPED)
@@ -1361,11 +1361,11 @@ void ExtractStat(char *stream, int *mboxsize, int *mails)
while (WS(finder)) finder++;
}
if (1 != sscanf(finder, "%d", mails))
- throw (DWORD)EPOP3_STAT;
+ throw (uint32_t)EPOP3_STAT;
while (!WS(finder)) finder++;
while (WS(finder)) finder++;
if (1 != sscanf(finder, "%d", mboxsize))
- throw (DWORD)EPOP3_STAT;
+ throw (uint32_t)EPOP3_STAT;
}
void ExtractMail(char *stream, int len, HYAMNMAIL queue)
{
@@ -1387,13 +1387,13 @@ void ExtractMail(char *stream, int len, HYAMNMAIL queue)
#endif
while (WS(finder)) finder++; //jump whitespace
if (1 != sscanf(finder, "%d", &msgnr))
- throw (DWORD)EPOP3_UIDL;
+ throw (uint32_t)EPOP3_UIDL;
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"<Nr>%d</Nr>\n",msgnr);
#endif
// for (i=1,queueptr=queue;(queueptr->Next != NULL) && (i<msgnr);queueptr=queueptr->Next,i++);
// if (i != msgnr)
- // throw (DWORD)EPOP3_UIDL;
+ // throw (uint32_t)EPOP3_UIDL;
while (!WS(finder)) finder++; //jump characters
while (WS(finder)) finder++; //jump whitespace
finderend = finder + 1;
@@ -1432,13 +1432,13 @@ void ExtractUIDL(char *stream, int len, HYAMNMAIL queue)
#endif
while (WS(finder)) finder++; //jump whitespace
if (1 != sscanf(finder, "%d", &msgnr))
- throw (DWORD)EPOP3_UIDL;
+ throw (uint32_t)EPOP3_UIDL;
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"<Nr>%d</Nr>\n",msgnr);
#endif
// for (i=1,queueptr=queue;(queueptr->Next != NULL) && (i<msgnr);queueptr=queueptr->Next,i++);
// if (i != msgnr)
- // throw (DWORD)EPOP3_UIDL;
+ // throw (uint32_t)EPOP3_UIDL;
while (!WS(finder)) finder++; //jump characters
while (WS(finder)) finder++; //jump whitespace
finderend = finder + 1;
@@ -1477,19 +1477,19 @@ void ExtractList(char *stream, int len, HYAMNMAIL queue)
#endif
while (WS(finder)) finder++; //jump whitespace
if (1 != sscanf(finder, "%d", &msgnr)) //message nr.
- throw (DWORD)EPOP3_LIST;
+ throw (uint32_t)EPOP3_LIST;
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"<Nr>%d</Nr>\n",msgnr);
#endif
for (i = 1, queueptr = queue; (queueptr->Next != nullptr) && (i < msgnr); queueptr = queueptr->Next, i++);
if (i != msgnr)
- throw (DWORD)EPOP3_LIST;
+ throw (uint32_t)EPOP3_LIST;
while (!WS(finder)) finder++; //jump characters
while (WS(finder)) finder++; //jump whitespace
finderend = finder + 1;
if (1 != sscanf(finder, "%u", &queueptr->MailData->Size))
- throw (DWORD)EPOP3_LIST;
+ throw (uint32_t)EPOP3_LIST;
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"<Nr>%d</Nr>\n",queueptr->MailData->Size);
#endif
diff --git a/protocols/YAMN/src/proto/pop3/pop3comm.h b/protocols/YAMN/src/proto/pop3/pop3comm.h
index 4abae49281..f8edceb731 100644
--- a/protocols/YAMN/src/proto/pop3/pop3comm.h
+++ b/protocols/YAMN/src/proto/pop3/pop3comm.h
@@ -18,7 +18,7 @@ typedef struct CPOP3Account: public CAccount
uint16_t CP; //access only through AccountAccessSO
// In this memeber last error code is stored
- DWORD SystemError; //access through UseInternetFree
+ uint32_t SystemError; //access through UseInternetFree
// We use only counter from this object and it is # of threads waiting to work on internet.
// We use event UseInternet to access critical sections.
@@ -39,10 +39,10 @@ typedef struct CPOP3Account: public CAccount
typedef struct POP3LayeredError
{
BOOL SSL;
- DWORD AppError;
- DWORD POP3Error;
- DWORD NetError;
- DWORD SystemError;
+ uint32_t AppError;
+ uint32_t POP3Error;
+ uint32_t NetError;
+ uint32_t SystemError;
} POP3_ERRORCODE,*PPOP3_ERRORCODE;
struct YAMNExportedFcns
diff --git a/protocols/YAMN/src/proto/pop3/pop3opt.cpp b/protocols/YAMN/src/proto/pop3/pop3opt.cpp
index dd85484a37..9561ba478e 100644
--- a/protocols/YAMN/src/proto/pop3/pop3opt.cpp
+++ b/protocols/YAMN/src/proto/pop3/pop3opt.cpp
@@ -260,7 +260,7 @@ BOOL DlgShowAccountStatus(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
HPOP3ACCOUNT ActualAccount = (HPOP3ACCOUNT)lParam;
- if ((DWORD)wParam == M_SHOWACTUAL) {
+ if ((uint32_t)wParam == M_SHOWACTUAL) {
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
#endif
@@ -294,7 +294,7 @@ BOOL DlgShowAccountPopup(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
HPOP3ACCOUNT ActualAccount = (HPOP3ACCOUNT)lParam;
- if ((DWORD)wParam == M_SHOWACTUAL) {
+ if ((uint32_t)wParam == M_SHOWACTUAL) {
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
#endif
@@ -342,7 +342,7 @@ BOOL DlgShowAccount(HWND hDlg, WPARAM wParam, LPARAM lParam)
HPOP3ACCOUNT ActualAccount = (HPOP3ACCOUNT)lParam;
int i;
- if ((DWORD)wParam == M_SHOWACTUAL) {
+ if ((uint32_t)wParam == M_SHOWACTUAL) {
wchar_t accstatus[256];
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
@@ -641,7 +641,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP
case WM_YAMN_CHANGETIME:
if ((HPOP3ACCOUNT)wParam == ActualAccount) {
wchar_t Text[256];
- mir_snwprintf(Text, TranslateT("Time left to next check [s]: %d"), (DWORD)lParam);
+ mir_snwprintf(Text, TranslateT("Time left to next check [s]: %d"), (uint32_t)lParam);
SetDlgItemText(hDlg, IDC_STTIMELEFT, Text);
}
return TRUE;
diff --git a/protocols/YAMN/src/protoplugin.cpp b/protocols/YAMN/src/protoplugin.cpp
index a0dd01ca01..c119f887bb 100644
--- a/protocols/YAMN/src/protoplugin.cpp
+++ b/protocols/YAMN/src/protoplugin.cpp
@@ -28,7 +28,7 @@ INT_PTR UnregisterProtoPlugins();
// YAMNMailFcn- pointer to imported functions with mails
// YAMNMailFcnVer- version of YAMN_MAILIMPORTFCN, use YAMN_MAILIMPORTFCNVERSION
// returns nonzero if success
-int WINAPI SetProtocolPluginFcnImportFcn(HYAMNPROTOPLUGIN Plugin,PYAMN_PROTOIMPORTFCN YAMNFcn,DWORD YAMNFcnVer,PYAMN_MAILIMPORTFCN YAMNMailFcn,DWORD YAMNMailFcnVer);
+int WINAPI SetProtocolPluginFcnImportFcn(HYAMNPROTOPLUGIN Plugin,PYAMN_PROTOIMPORTFCN YAMNFcn,uint32_t YAMNFcnVer,PYAMN_MAILIMPORTFCN YAMNMailFcn,uint32_t YAMNMailFcnVer);
struct CExportedFunctions ProtoPluginExportedFcn[]=
{
@@ -74,7 +74,7 @@ INT_PTR RegisterProtocolPluginSvc(WPARAM wParam,LPARAM lParam)
return (INT_PTR)Plugin;
}
-int WINAPI SetProtocolPluginFcnImportFcn(HYAMNPROTOPLUGIN Plugin,PYAMN_PROTOIMPORTFCN YAMNFcn,DWORD YAMNFcnVer,PYAMN_MAILIMPORTFCN YAMNMailFcn,DWORD YAMNMailFcnVer)
+int WINAPI SetProtocolPluginFcnImportFcn(HYAMNPROTOPLUGIN Plugin,PYAMN_PROTOIMPORTFCN YAMNFcn,uint32_t YAMNFcnVer,PYAMN_MAILIMPORTFCN YAMNMailFcn,uint32_t YAMNMailFcnVer)
{
PYAMN_PROTOPLUGINQUEUE Parser;
diff --git a/protocols/YAMN/src/services.cpp b/protocols/YAMN/src/services.cpp
index 98fd18f24d..b84acefcec 100644
--- a/protocols/YAMN/src/services.cpp
+++ b/protocols/YAMN/src/services.cpp
@@ -117,7 +117,7 @@ static INT_PTR ContactApplication(WPARAM wParam, LPARAM)
return 0;
}
-DWORD WINAPI SWMRGWaitToRead(PSWMRG pSWMRG, DWORD dwTimeout);
+uint32_t WINAPI SWMRGWaitToRead(PSWMRG pSWMRG, uint32_t dwTimeout);
static INT_PTR AccountMailCheck(WPARAM wParam, LPARAM lParam)
{
//This service will check/sincronize the account pointed by wParam
diff --git a/protocols/YAMN/src/stdafx.h b/protocols/YAMN/src/stdafx.h
index 1925042acb..e15a79096c 100644
--- a/protocols/YAMN/src/stdafx.h
+++ b/protocols/YAMN/src/stdafx.h
@@ -83,18 +83,18 @@ int InitAccount(CAccount *Which);
void DeInitAccount(CAccount *Which);
void StopSignalFcn(CAccount *Which);
void CodeDecodeString(char *Dest, BOOL Encrypt);
-DWORD FileToMemory(wchar_t *FileName, char **MemFile, char **End);
+uint32_t FileToMemory(wchar_t *FileName, char **MemFile, char **End);
#if defined(DEBUG_FILEREAD) || defined(DEBUG_FILEREADMESSAGES)
-DWORD ReadStringFromMemory(char **Parser,char *End,char **StoreTo,char *DebugString);
+uint32_t ReadStringFromMemory(char **Parser,char *End,char **StoreTo,char *DebugString);
#endif
-DWORD ReadStringFromMemory(char **Parser, char *End, char **StoreTo);
-DWORD ReadMessagesFromMemory(CAccount *Which, char **Parser, char *End);
-DWORD ReadAccountFromMemory(CAccount *Which, char **Parser, wchar_t *End);
+uint32_t ReadStringFromMemory(char **Parser, char *End, char **StoreTo);
+uint32_t ReadMessagesFromMemory(CAccount *Which, char **Parser, char *End);
+uint32_t ReadAccountFromMemory(CAccount *Which, char **Parser, wchar_t *End);
INT_PTR AddAccountsFromFileSvc(WPARAM wParam, LPARAM lParam);
-DWORD WriteStringToFile(HANDLE File, char *Source);
-DWORD WriteStringToFileW(HANDLE File, wchar_t *Source);
+uint32_t WriteStringToFile(HANDLE File, char *Source);
+uint32_t WriteStringToFileW(HANDLE File, wchar_t *Source);
DWORD WriteMessagesToFile(HANDLE File, CAccount *Which);
@@ -180,22 +180,22 @@ extern UINT SecTimer;
//From synchro.cpp
void WINAPI DeleteMessagesToEndFcn(CAccount *Account, HYAMNMAIL From);
-DWORD WINAPI WaitToWriteFcn(PSWMRG SObject, PSCOUNTER SCounter = nullptr);
+uint32_t WINAPI WaitToWriteFcn(PSWMRG SObject, PSCOUNTER SCounter = nullptr);
void WINAPI WriteDoneFcn(PSWMRG SObject, PSCOUNTER SCounter = nullptr);
-DWORD WINAPI WaitToReadFcn(PSWMRG SObject);
+uint32_t WINAPI WaitToReadFcn(PSWMRG SObject);
void WINAPI ReadDoneFcn(PSWMRG SObject);
-DWORD WINAPI SCIncFcn(PSCOUNTER SCounter);
-DWORD WINAPI SCDecFcn(PSCOUNTER SCounter);
+uint32_t WINAPI SCIncFcn(PSCOUNTER SCounter);
+uint32_t WINAPI SCDecFcn(PSCOUNTER SCounter);
BOOL WINAPI SWMRGInitialize(PSWMRG, wchar_t *);
void WINAPI SWMRGDelete(PSWMRG);
-DWORD WINAPI SWMRGWaitToWrite(PSWMRG pSWMRG, DWORD dwTimeout);
+uint32_t WINAPI SWMRGWaitToWrite(PSWMRG pSWMRG, uint32_t dwTimeout);
void WINAPI SWMRGDoneWriting(PSWMRG pSWMRG);
-DWORD WINAPI SWMRGWaitToRead(PSWMRG pSWMRG, DWORD dwTimeout);
+uint32_t WINAPI SWMRGWaitToRead(PSWMRG pSWMRG, uint32_t dwTimeout);
void WINAPI SWMRGDoneReading(PSWMRG pSWMRG);
//From mails.cpp
void WINAPI DeleteMessageFromQueueFcn(HYAMNMAIL *From, HYAMNMAIL Which, int mode);
-void WINAPI SetRemoveFlagsInQueueFcn(HYAMNMAIL From, DWORD FlagsSet, DWORD FlagsNotSet, DWORD FlagsToSet, int mode);
+void WINAPI SetRemoveFlagsInQueueFcn(HYAMNMAIL From, uint32_t FlagsSet, uint32_t FlagsNotSet, uint32_t FlagsToSet, int mode);
//From mime.cpp
void ExtractHeader(struct CMimeItem *items, int &CP, struct CHeader *head);
@@ -246,9 +246,9 @@ extern struct WndHandles *MessageWnd;
extern int GetCharsetFromString(char *input, size_t size);
extern void SendMsgToRecepients(struct WndHandles *FirstWin, UINT msg, WPARAM wParam, LPARAM lParam);
-extern void ConvertCodedStringToUnicode(char *stream, wchar_t **storeto, DWORD cp, int mode);
+extern void ConvertCodedStringToUnicode(char *stream, wchar_t **storeto, uint32_t cp, int mode);
extern void __cdecl MailBrowser(void *Param);
-extern DWORD WINAPI NoNewMailProc(LPVOID Param);
+extern uint32_t WINAPI NoNewMailProc(LPVOID Param);
extern void __cdecl BadConnection(void *Param);
extern PVOID TLSCtx;
extern PVOID SSLCtx;
diff --git a/protocols/YAMN/src/synchro.cpp b/protocols/YAMN/src/synchro.cpp
index b6007d992d..f377ef158a 100644
--- a/protocols/YAMN/src/synchro.cpp
+++ b/protocols/YAMN/src/synchro.cpp
@@ -26,7 +26,7 @@ void WINAPI SWMRGDelete(PSWMRG pSWMRG);
// it can successfully write to the shared data.
// returns WAIT_FINISH when we are in write-access or WAIT_FAILED
// when event about quick finishing is set (or when system returns fail when waiting for synchro object)
-DWORD WINAPI SWMRGWaitToWrite(PSWMRG pSWMRG,DWORD dwTimeout);
+uint32_t WINAPI SWMRGWaitToWrite(PSWMRG pSWMRG,uint32_t dwTimeout);
// A writer thread calls this function to let other threads
// know that it no longer needs to write to the shared data.
@@ -36,7 +36,7 @@ void WINAPI SWMRGDoneWriting(PSWMRG pSWMRG);
// it can successfully read the shared data.
// returns WAIT_FINISH when we are in read-access or WAIT_FAILED
// when event about quick finishing is set (or when system returns fail when waiting for synchro object)
-DWORD WINAPI SWMRGWaitToRead(PSWMRG pSWMRG, DWORD dwTimeout);
+uint32_t WINAPI SWMRGWaitToRead(PSWMRG pSWMRG, uint32_t dwTimeout);
// A reader thread calls this function to let other threads
// know when it no longer needs to read the shared data.
@@ -46,7 +46,7 @@ void WINAPI SWMRGDoneReading(PSWMRG pSWMRG);
// is used to wait for read access with SWMRG SO, but it also increments counter if successfull
// returns WAIT_FAILED or WAIT_FINISH
// when WAIT_FAILED, we should not begin to access datas, we are not in read-access mode
-DWORD WINAPI WaitToReadFcn(PSWMRG SObject);
+uint32_t WINAPI WaitToReadFcn(PSWMRG SObject);
// WriteDoneFcn
// is used to release read access with SWMRG SO, but it also decrements counter if successfull
@@ -59,16 +59,16 @@ void WINAPI ReadDoneFcn(PSWMRG SObject);
// Note you must not read the number from memory directly, because
// CPU can stop reading thread when it has read HI-Word, then another thread
// can change the value and then OS starts the previous thread, that reads the
-// LO-uint16_t of DWORD. And the return value HI+LO-uint16_t is corrupted
-DWORD WINAPI SCGetNumberFcn(PSCOUNTER SCounter);
+// LO-uint16_t of uint32_t. And the return value HI+LO-uint16_t is corrupted
+uint32_t WINAPI SCGetNumberFcn(PSCOUNTER SCounter);
// Increments SCOUNTER and unsets event
// Returns Number after incrementing
-DWORD WINAPI SCIncFcn(PSCOUNTER SCounter);
+uint32_t WINAPI SCIncFcn(PSCOUNTER SCounter);
// Decrements SCOUNTER and sets event if zero
// Returns Number after decrementing
-DWORD WINAPI SCDecFcn(PSCOUNTER SCounter);
+uint32_t WINAPI SCDecFcn(PSCOUNTER SCounter);
struct CExportedFunctions SynchroExportedFcn[]=
{
@@ -140,9 +140,9 @@ BOOL WINAPI SWMRGInitialize(PSWMRG pSWMRG,wchar_t *Name)
return TRUE;
}
-DWORD WINAPI SWMRGWaitToWrite(PSWMRG pSWMRG,DWORD dwTimeout)
+uint32_t WINAPI SWMRGWaitToWrite(PSWMRG pSWMRG,uint32_t dwTimeout)
{
- DWORD dw;
+ uint32_t dw;
HANDLE aHandles[2];
// We can write if the following are true:
@@ -183,9 +183,9 @@ void WINAPI SWMRGDoneWriting(PSWMRG pSWMRG)
SetEvent(pSWMRG->hEventNoWriter);
}
-DWORD WINAPI SWMRGWaitToRead(PSWMRG pSWMRG, DWORD dwTimeout)
+uint32_t WINAPI SWMRGWaitToRead(PSWMRG pSWMRG, uint32_t dwTimeout)
{
- DWORD dw;
+ uint32_t dw;
LONG lPreviousCount;
// We can read if no threads are writing.
@@ -254,9 +254,9 @@ void WINAPI SWMRGDoneReading(PSWMRG pSWMRG)
SetEvent(pSWMRG->hEventNoWriter);
}
-DWORD WINAPI WaitToWriteFcn(PSWMRG SObject,PSCOUNTER SCounter)
+uint32_t WINAPI WaitToWriteFcn(PSWMRG SObject,PSCOUNTER SCounter)
{
- DWORD EnterCode;
+ uint32_t EnterCode;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"\tSO WaitToWrite: %x\n",SObject);
#endif
@@ -276,9 +276,9 @@ void WINAPI WriteDoneFcn(PSWMRG SObject,PSCOUNTER SCounter)
SCDecFcn(SCounter);
}
-DWORD WINAPI WaitToReadFcn(PSWMRG SObject)
+uint32_t WINAPI WaitToReadFcn(PSWMRG SObject)
{
- DWORD EnterCode;
+ uint32_t EnterCode;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"\tSO WaitToRead: %x\n",SObject);
#endif
@@ -294,9 +294,9 @@ void WINAPI ReadDoneFcn(PSWMRG SObject)
SWMRGDoneReading(SObject);
}
-DWORD WINAPI SCGetNumberFcn(PSCOUNTER SCounter)
+uint32_t WINAPI SCGetNumberFcn(PSCOUNTER SCounter)
{
- DWORD Temp;
+ uint32_t Temp;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"\tGetNumber-cs wait\n");
#endif
@@ -313,9 +313,9 @@ DWORD WINAPI SCGetNumberFcn(PSCOUNTER SCounter)
return Temp;
}
-DWORD WINAPI SCIncFcn(PSCOUNTER SCounter)
+uint32_t WINAPI SCIncFcn(PSCOUNTER SCounter)
{
- DWORD Temp;
+ uint32_t Temp;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"\tIncrementValue-cs wait\n");
#endif
@@ -333,9 +333,9 @@ DWORD WINAPI SCIncFcn(PSCOUNTER SCounter)
return Temp;
}
-DWORD WINAPI SCDecFcn(PSCOUNTER SCounter)
+uint32_t WINAPI SCDecFcn(PSCOUNTER SCounter)
{
- DWORD Temp;
+ uint32_t Temp;
#ifdef DEBUG_SYNCHRO
DebugLog(SynchroFile,"\tDecrementValue-cs wait\n");
#endif
diff --git a/protocols/YAMN/src/yamn.cpp b/protocols/YAMN/src/yamn.cpp
index ff5ddfceee..95156a4496 100644
--- a/protocols/YAMN/src/yamn.cpp
+++ b/protocols/YAMN/src/yamn.cpp
@@ -34,7 +34,7 @@ INT_PTR GetVariablesSvc(WPARAM wParam, LPARAM);
// Function every seconds decrements account counter of seconds and checks if they are 0
// If yes, creates a POP3 thread to check account
-void CALLBACK TimerProc(HWND, UINT, UINT, DWORD);
+void CALLBACK TimerProc(HWND, UINT, UINT, uint32_t);
// Function called to check all accounts immidialtelly
// no params
@@ -42,7 +42,7 @@ INT_PTR ForceCheckSvc(WPARAM, LPARAM);
//thread is running all the time
//waits for WriteToFileEV and then writes all accounts to file
-//DWORD WINAPI FileWritingThread(PVOID);
+//uint32_t WINAPI FileWritingThread(PVOID);
// Function is called when Miranda notifies plugin that it is about to exit
// Ensures succesfull end of POP3 checking, sets event that no next checking should be performed
@@ -57,7 +57,7 @@ INT_PTR ForceCheckSvc(WPARAM, LPARAM);
INT_PTR GetFcnPtrSvc(WPARAM wParam, LPARAM)
{
- register int i;
+ int i;
for (i=0;i<sizeof(ProtoPluginExportedFcn)/sizeof(ProtoPluginExportedFcn[0]);i++)
if (0==mir_strcmp((char *)wParam, ProtoPluginExportedFcn[i].ID))