diff options
Diffstat (limited to 'protocols')
155 files changed, 635 insertions, 642 deletions
diff --git a/protocols/CloudFile/src/utils.cpp b/protocols/CloudFile/src/utils.cpp index da5ca75595..c2693960ca 100644 --- a/protocols/CloudFile/src/utils.cpp +++ b/protocols/CloudFile/src/utils.cpp @@ -23,7 +23,7 @@ void ShowNotification(const wchar_t *message, int flags, MCONTACT hContact) ShowNotification(_A2W(MODULENAME), message, flags, hContact); } -MEVENT AddEventToDb(MCONTACT hContact, uint16_t type, DWORD flags, DWORD cbBlob, uint8_t *pBlob) +MEVENT AddEventToDb(MCONTACT hContact, uint16_t type, uint32_t flags, uint32_t cbBlob, uint8_t *pBlob) { DBEVENTINFO dbei = {}; dbei.szModule = MODULENAME; @@ -74,7 +74,7 @@ void SendToContact(MCONTACT hContact, const wchar_t *data) char *message = mir_utf8encodeW(data); if (ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)message) != ACKRESULT_FAILED) - AddEventToDb(hContact, EVENTTYPE_MESSAGE, DBEF_UTF | DBEF_SENT, (DWORD)mir_strlen(message), (uint8_t*)message); + AddEventToDb(hContact, EVENTTYPE_MESSAGE, DBEF_UTF | DBEF_SENT, (uint32_t)mir_strlen(message), (uint8_t*)message); } void PasteToInputArea(MCONTACT hContact, const wchar_t *data) diff --git a/protocols/ConnectionNotify/src/ConnectionNotify.cpp b/protocols/ConnectionNotify/src/ConnectionNotify.cpp index f6fd89cb20..df5997621c 100644 --- a/protocols/ConnectionNotify/src/ConnectionNotify.cpp +++ b/protocols/ConnectionNotify/src/ConnectionNotify.cpp @@ -11,8 +11,8 @@ HANDLE hFilterOptionsThread = nullptr; HANDLE killCheckThreadEvent = nullptr; HANDLE hExceptionsMutex = nullptr; -DWORD FilterOptionsThreadId; -DWORD ConnectionCheckThreadId; +uint32_t FilterOptionsThreadId; +uint32_t ConnectionCheckThreadId; CONNECTION *first = nullptr; CONNECTION *connExceptions = nullptr; @@ -144,8 +144,8 @@ void LoadSettings() g_plugin.iDefaultAction = g_plugin.getByte("FilterDefaultAction", TRUE); g_plugin.bSetColours = g_plugin.getBool("PopupSetColours"); - g_plugin.BgColor = g_plugin.getDword("PopupBgColor", (DWORD)0xFFFFFF); - g_plugin.FgColor = g_plugin.getDword("PopupFgColor", (DWORD)0x000000); + g_plugin.BgColor = g_plugin.getDword("PopupBgColor", (uint32_t)0xFFFFFF); + g_plugin.FgColor = g_plugin.getDword("PopupFgColor", (uint32_t)0x000000); g_plugin.iFiltersCount = g_plugin.getDword("FiltersCount"); g_plugin.iStatusMask = g_plugin.getWord("StatusMask", 16); for (int i = 0; i < MAX_STATUS_COUNT; i++) { @@ -318,7 +318,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA } //show popup -void showMsg(wchar_t *pName, DWORD pid, wchar_t *intIp, wchar_t *extIp, int intPort, int extPort, int state) +void showMsg(wchar_t *pName, uint32_t pid, wchar_t *intIp, wchar_t *extIp, int intPort, int extPort, int state) { CONNECTION *mpd = (CONNECTION*)mir_alloc(sizeof(CONNECTION)); diff --git a/protocols/ConnectionNotify/src/netstat.cpp b/protocols/ConnectionNotify/src/netstat.cpp index 6efa62533c..b682ddea24 100644 --- a/protocols/ConnectionNotify/src/netstat.cpp +++ b/protocols/ConnectionNotify/src/netstat.cpp @@ -33,7 +33,7 @@ CONNECTION *GetConnectionsTable() //printf("Number of entries: %d\n", (int) pTcpTable->dwNumEntries); struct in_addr IpAddr; CONNECTION *connHead = nullptr; - for (DWORD i = 0; i < pTcpTable->dwNumEntries; i++) { + for (uint32_t i = 0; i < pTcpTable->dwNumEntries; i++) { CONNECTION *newConn = (CONNECTION*)mir_alloc(sizeof(CONNECTION)); memset(newConn, 0, sizeof(CONNECTION)); //pid2name(pTcpTable->table[i].dwOwningPid,&newConn->Pname); diff --git a/protocols/ConnectionNotify/src/netstat.h b/protocols/ConnectionNotify/src/netstat.h index de54663906..8272defa2a 100644 --- a/protocols/ConnectionNotify/src/netstat.h +++ b/protocols/ConnectionNotify/src/netstat.h @@ -7,7 +7,7 @@ struct CONNECTION int intIntPort; int intExtPort; int state; - DWORD Pid; + uint32_t Pid; wchar_t PName[260]; CONNECTION *next; }; diff --git a/protocols/ConnectionNotify/src/pid2name.cpp b/protocols/ConnectionNotify/src/pid2name.cpp index f5c10ca9e6..0a4cc90d67 100644 --- a/protocols/ConnectionNotify/src/pid2name.cpp +++ b/protocols/ConnectionNotify/src/pid2name.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -void pid2name(DWORD procid, wchar_t *buffer, size_t bufLen) +void pid2name(uint32_t procid, wchar_t *buffer, size_t bufLen) { PROCESSENTRY32 ProcessStruct; ProcessStruct.dwSize = sizeof(PROCESSENTRY32); diff --git a/protocols/ConnectionNotify/src/pid2name.h b/protocols/ConnectionNotify/src/pid2name.h index 96338a14b1..493379b8aa 100644 --- a/protocols/ConnectionNotify/src/pid2name.h +++ b/protocols/ConnectionNotify/src/pid2name.h @@ -3,6 +3,6 @@ #ifndef _INC_PID2NAME #define _INC_PID2NAME -void pid2name(DWORD, wchar_t*, size_t); +void pid2name(uint32_t, wchar_t*, size_t); #endif diff --git a/protocols/ConnectionNotify/src/stdafx.h b/protocols/ConnectionNotify/src/stdafx.h index cbb3bb9ef0..436385367b 100644 --- a/protocols/ConnectionNotify/src/stdafx.h +++ b/protocols/ConnectionNotify/src/stdafx.h @@ -54,7 +54,7 @@ struct CMPlugin : public PLUGIN<CMPlugin> int Unload() override; }; -void showMsg(wchar_t *pName,DWORD pid,wchar_t *intIp,wchar_t *extIp,int intPort,int extPort,int state); +void showMsg(wchar_t *pName,uint32_t pid,wchar_t *intIp,wchar_t *extIp,int intPort,int extPort,int state); static unsigned __stdcall checkthread(void *dummy); CONNECTION * LoadSettingsConnections(); void saveSettingsConnections(CONNECTION *connHead); @@ -62,7 +62,7 @@ void LoadSettings(); extern CONNECTION *connExceptions; extern HANDLE hFilterOptionsThread; -extern DWORD FilterOptionsThreadId; +extern uint32_t FilterOptionsThreadId; extern CONNECTION *connCurrentEdit; extern HANDLE hExceptionsMutex; extern BOOL bOptionsOpen; diff --git a/protocols/CurrencyRates/src/CurrencyRateChart.cpp b/protocols/CurrencyRates/src/CurrencyRateChart.cpp index 315a14144d..578ae7d64d 100644 --- a/protocols/CurrencyRates/src/CurrencyRateChart.cpp +++ b/protocols/CurrencyRates/src/CurrencyRateChart.cpp @@ -66,7 +66,7 @@ INT_PTR CurrencyRatesMenu_Chart(WPARAM wp, LPARAM /*lp*/) if(auto hWnd = ::FindWindow(nullptr,_T("Miranda CurrencyRates Chart"))) { COPYDATASTRUCT copydata_struct; - copydata_struct.cbData = static_cast<DWORD>(sLogFileName.GetLength() * sizeof(TCHAR)); + copydata_struct.cbData = static_cast<uint32_t>(sLogFileName.GetLength() * sizeof(TCHAR)); copydata_struct.lpData = const_cast<void*>(static_cast<const void*>(sLogFileName.c_str())); copydata_struct.dwData = 0x1945; diff --git a/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp b/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp index 3a9b13cff5..373cbc957b 100644 --- a/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp +++ b/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp @@ -405,7 +405,7 @@ void log_to_history(const ICurrencyRatesProvider *pProvider, MCONTACT hContact, DBEVENTINFO dbei = {}; dbei.szModule = MODULENAME; - dbei.timestamp = static_cast<DWORD>(nTime); + dbei.timestamp = static_cast<uint32_t>(nTime); dbei.flags = DBEF_READ | DBEF_UTF; dbei.eventType = EVENTTYPE_MESSAGE; dbei.cbBlob = (int)::mir_strlen(psz) + 1; @@ -604,7 +604,7 @@ MCONTACT CCurrencyRatesProviderBase::CreateNewContact(const CMStringW &rsName) return hContact; } -DWORD get_refresh_timeout_miliseconds() +uint32_t get_refresh_timeout_miliseconds() { if (!g_bAutoUpdate) return INFINITE; @@ -613,7 +613,7 @@ DWORD get_refresh_timeout_miliseconds() if (nRefreshRateType < RRT_SECONDS || nRefreshRateType > RRT_HOURS) nRefreshRateType = RRT_MINUTES; - DWORD nTimeout = g_plugin.getWord(DB_KEY_RefreshRateValue, 1); + uint32_t nTimeout = g_plugin.getWord(DB_KEY_RefreshRateValue, 1); switch (nRefreshRateType) { default: case RRT_SECONDS: @@ -651,7 +651,7 @@ private: void CCurrencyRatesProviderBase::Run() { - DWORD nTimeout = get_refresh_timeout_miliseconds(); + uint32_t nTimeout = get_refresh_timeout_miliseconds(); m_sContactListFormat = g_plugin.getMStringW(DB_KEY_DisplayNameFormat, DB_DEF_DisplayNameFormat); m_sStatusMsgFormat = g_plugin.getMStringW(DB_KEY_StatusMsgFormat, DB_DEF_StatusMsgFormat); m_sTendencyFormat = g_plugin.getMStringW(DB_KEY_TendencyFormat, DB_DEF_TendencyFormat); @@ -685,8 +685,8 @@ void CCurrencyRatesProviderBase::Run() while (false == bGoToBed) { anContacts.clear(); - DWORD dwBegin = ::GetTickCount(); - DWORD dwResult = ::WaitForMultipleObjects(COUNT_SYNC_OBJECTS, anEvents, FALSE, nTimeout); + uint32_t dwBegin = ::GetTickCount(); + uint32_t dwResult = ::WaitForMultipleObjects(COUNT_SYNC_OBJECTS, anEvents, FALSE, nTimeout); switch (dwResult) { case WAIT_FAILED: assert(!"WaitForMultipleObjects failed"); @@ -715,7 +715,7 @@ void CCurrencyRatesProviderBase::Run() case WAIT_OBJECT_0 + REFRESH_CONTACT: { - DWORD dwTimeRest = ::GetTickCount() - dwBegin; + uint32_t dwTimeRest = ::GetTickCount() - dwBegin; if (INFINITE != nTimeout && dwTimeRest < nTimeout) nTimeout -= dwTimeRest; diff --git a/protocols/CurrencyRates/src/Forex.cpp b/protocols/CurrencyRates/src/Forex.cpp index 3395c1e999..f36ecad292 100644 --- a/protocols/CurrencyRates/src/Forex.cpp +++ b/protocols/CurrencyRates/src/Forex.cpp @@ -230,7 +230,7 @@ void WaitForWorkingThreads() size_t cThreads = g_ahThreads.size(); if (cThreads > 0) { HANDLE* paHandles = &*(g_ahThreads.begin()); - ::WaitForMultipleObjects((DWORD)cThreads, paHandles, TRUE, INFINITE); + ::WaitForMultipleObjects((uint32_t)cThreads, paHandles, TRUE, INFINITE); } } diff --git a/protocols/CurrencyRates/src/Locale.cpp b/protocols/CurrencyRates/src/Locale.cpp index 758773233c..c91e9af5e6 100644 --- a/protocols/CurrencyRates/src/Locale.cpp +++ b/protocols/CurrencyRates/src/Locale.cpp @@ -12,8 +12,7 @@ static CMStringW get_int_registry_value(LPCTSTR pszValueName) LONG lResult = ::RegOpenKeyEx(HKEY_CURRENT_USER, L"Control Panel\\International", 0, KEY_QUERY_VALUE, &hKey); if ((ERROR_SUCCESS == lResult) && (nullptr != hKey)) { - DWORD dwType = 0; - DWORD dwSize = 0; + DWORD dwType = 0, dwSize = 0; lResult = ::RegQueryValueEx(hKey, pszValueName, nullptr, &dwType, nullptr, &dwSize); if ((ERROR_SUCCESS == lResult) && ((REG_SZ == dwType) || (REG_EXPAND_SZ == dwType))) { sResult.Truncate(dwSize); diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp index 45fba1fb94..c7597280ad 100644 --- a/protocols/Discord/src/dispatch.cpp +++ b/protocols/Discord/src/dispatch.cpp @@ -416,7 +416,7 @@ void CDiscordProto::OnCommandMessage(const JSONNode &pRoot, bool bIsNew) debugLogA("store a message from private user %lld, channel id %lld", pUser->id, pUser->channelId); ptrA buf(mir_utf8encodeW(wszText)); - recv.timestamp = (DWORD)StringToDate(pRoot["timestamp"].as_mstring()); + recv.timestamp = (uint32_t)StringToDate(pRoot["timestamp"].as_mstring()); recv.szMessage = buf; recv.szMsgId = szMsgId; ProtoChainRecvMsg(pUser->hContact, &recv); @@ -440,7 +440,7 @@ void CDiscordProto::OnCommandMessage(const JSONNode &pRoot, bool bIsNew) gce.dwFlags = GCEF_ADDTOLOG; gce.pszUID.w = wszUserId; gce.pszText.w = wszText; - gce.time = (DWORD)StringToDate(pRoot["timestamp"].as_mstring()); + gce.time = (uint32_t)StringToDate(pRoot["timestamp"].as_mstring()); gce.bIsMe = bOurMessage; Chat_Event(&gce); diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h index 13c920be77..bf3929fd55 100644 --- a/protocols/Discord/src/proto.h +++ b/protocols/Discord/src/proto.h @@ -42,7 +42,7 @@ struct CDiscordRole : public MZeroedObject { SnowFlake id; COLORREF color; - DWORD permissions; + uint32_t permissions; int position; CMStringW wszName; }; diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp index 91c573d4db..450889a9de 100644 --- a/protocols/Discord/src/server.cpp +++ b/protocols/Discord/src/server.cpp @@ -89,7 +89,7 @@ void CDiscordProto::OnReceiveHistory(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest CMStringW wszUserId = pNode["author"]["id"].as_mstring(); SnowFlake msgid = ::getId(pNode["id"]); SnowFlake authorid = _wtoi64(wszUserId); - DWORD dwTimeStamp = StringToDate(pNode["timestamp"].as_mstring()); + uint32_t dwTimeStamp = StringToDate(pNode["timestamp"].as_mstring()); if (pUser->bIsPrivate) { DBEVENTINFO dbei = {}; @@ -110,7 +110,7 @@ void CDiscordProto::OnReceiveHistory(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest ptrA szBody(mir_utf8encodeW(wszText)); dbei.timestamp = dwTimeStamp; dbei.pBlob = (uint8_t*)szBody.get(); - dbei.cbBlob = (DWORD)mir_strlen(szBody); + dbei.cbBlob = (uint32_t)mir_strlen(szBody); bool bSucceeded = false; char szMsgId[100]; diff --git a/protocols/Discord/src/utils.cpp b/protocols/Discord/src/utils.cpp index a3764f9b35..b3106be71f 100644 --- a/protocols/Discord/src/utils.cpp +++ b/protocols/Discord/src/utils.cpp @@ -336,7 +336,7 @@ void CDiscordProto::ProcessType(CDiscordUser *pUser, const JSONNode &pRoot) DB::AUTH_BLOB blob(pUser->hContact, T2Utf(pUser->wszUsername), nullptr, nullptr, szId, nullptr); PROTORECVEVENT pre = { 0 }; - pre.timestamp = (DWORD)time(0); + pre.timestamp = (uint32_t)time(0); pre.lParam = blob.size(); pre.szMessage = blob; ProtoChainRecv(pUser->hContact, PSR_AUTH, 0, (LPARAM)&pre); diff --git a/protocols/Discord/src/voice.cpp b/protocols/Discord/src/voice.cpp index 723376091e..ad2184230e 100644 --- a/protocols/Discord/src/voice.cpp +++ b/protocols/Discord/src/voice.cpp @@ -41,7 +41,7 @@ void CDiscordProto::OnCommandCallCreated(const JSONNode &pRoot) dbei.szModule = m_szModuleName; dbei.timestamp = pCall->startTime; dbei.eventType = EVENT_INCOMING_CALL; - dbei.cbBlob = DWORD(mir_strlen(szMessage) + 1); + dbei.cbBlob = uint32_t(mir_strlen(szMessage) + 1); dbei.pBlob = (uint8_t *)szMessage; dbei.flags = DBEF_UTF; db_event_add(pUser->hContact, &dbei); @@ -75,7 +75,7 @@ void CDiscordProto::OnCommandCallDeleted(const JSONNode &pRoot) dbei.szModule = m_szModuleName; dbei.timestamp = currTime; dbei.eventType = EVENT_CALL_FINISHED; - dbei.cbBlob = DWORD(szMessage.GetLength() + 1); + dbei.cbBlob = uint32_t(szMessage.GetLength() + 1); dbei.pBlob = (uint8_t *)szMessage.c_str(); dbei.flags = DBEF_UTF; db_event_add(pUser->hContact, &dbei); diff --git a/protocols/EmLanProto/src/amdproto.cpp b/protocols/EmLanProto/src/amdproto.cpp index 77ad692cf1..bc4d7655f1 100644 --- a/protocols/EmLanProto/src/amdproto.cpp +++ b/protocols/EmLanProto/src/amdproto.cpp @@ -44,7 +44,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC //////////////////////////////////////////////////////////////////////////
-BOOL APIENTRY DllMain(HINSTANCE hInstDLL, DWORD reason, LPVOID)
+BOOL APIENTRY DllMain(HINSTANCE hInstDLL, uint32_t reason, LPVOID)
{
if (reason == DLL_PROCESS_ATTACH) {
EMLOG("EmLan Started");
diff --git a/protocols/EmLanProto/src/get_time.cpp b/protocols/EmLanProto/src/get_time.cpp index 6ffccc5047..bb8f71915c 100644 --- a/protocols/EmLanProto/src/get_time.cpp +++ b/protocols/EmLanProto/src/get_time.cpp @@ -28,9 +28,9 @@ static int IsLeapYear(int year) return 1;
}
-static DWORD YMDHMSToTime(int year,int month,int day,int hour,int minute,int second)
+static uint32_t YMDHMSToTime(int year,int month,int day,int hour,int minute,int second)
{
- DWORD ret=0;
+ uint32_t ret=0;
int i;
for(i=1970;i<year;i++) ret+=365+IsLeapYear(i);
@@ -41,7 +41,7 @@ static DWORD YMDHMSToTime(int year,int month,int day,int hour,int minute,int sec return ret+3600*hour+60*minute+second;
}
-DWORD get_time()
+uint32_t get_time()
{
SYSTEMTIME stime;
GetSystemTime(&stime);
diff --git a/protocols/EmLanProto/src/get_time.h b/protocols/EmLanProto/src/get_time.h index 9f5676c5d3..a9d1eb9743 100644 --- a/protocols/EmLanProto/src/get_time.h +++ b/protocols/EmLanProto/src/get_time.h @@ -20,6 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __GET_TIME_H__
#define __GET_TIME_H__
-DWORD get_time();
+uint32_t get_time();
#endif //__GET_TIME_H__
diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index 4833b0356a..f04313ad9e 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -328,7 +328,7 @@ void CMLan::RecvMessageUrl(CCSDATA *ccs) dbei.szModule = MODULENAME; dbei.timestamp = pre->timestamp; dbei.flags = DBEF_UTF + ((pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0); - dbei.cbBlob = (DWORD)mir_strlen(szMessage) + 1; + dbei.cbBlob = (uint32_t)mir_strlen(szMessage) + 1; dbei.pBlob = (uint8_t*)szMessage.get(); db_event_add(ccs->hContact, &dbei); } @@ -904,7 +904,7 @@ void CMLan::RecvFile(CCSDATA *ccs) Contact_Hide(ccs->hContact, false); - char *szFile = pre->szMessage + sizeof(DWORD); + char *szFile = pre->szMessage + sizeof(uint32_t); char *szDesc = szFile + mir_strlen(szFile) + 1; DBEVENTINFO dbei = {}; @@ -912,7 +912,7 @@ void CMLan::RecvFile(CCSDATA *ccs) dbei.timestamp = pre->timestamp; dbei.flags = pre->flags & (PREF_CREATEREAD ? DBEF_READ : 0); dbei.eventType = EVENTTYPE_FILE; - dbei.cbBlob = DWORD(sizeof(DWORD) + mir_strlen(szFile) + mir_strlen(szDesc) + 2); + dbei.cbBlob = uint32_t(sizeof(uint32_t) + mir_strlen(szFile) + mir_strlen(szDesc) + 2); dbei.pBlob = (uint8_t*)pre->szMessage; db_event_add(ccs->hContact, &dbei); } diff --git a/protocols/Facebook/src/proto.cpp b/protocols/Facebook/src/proto.cpp index c557c42dff..35776929f9 100644 --- a/protocols/Facebook/src/proto.cpp +++ b/protocols/Facebook/src/proto.cpp @@ -69,7 +69,7 @@ FacebookProto::FacebookProto(const char *proto_name, const wchar_t *username) : m_szClientID = getMStringA(DBKEY_CLIENT_ID); if (m_szClientID.IsEmpty()) { for (int i = 0; i < 20; i++) { - DWORD dwRandon; + uint32_t dwRandon; Utils_GetRandom(&dwRandon, sizeof(dwRandon)); int c = dwRandon % 62; if (c >= 0 && c < 26) diff --git a/protocols/Facebook/src/server.cpp b/protocols/Facebook/src/server.cpp index 5455806163..77550740d5 100644 --- a/protocols/Facebook/src/server.cpp +++ b/protocols/Facebook/src/server.cpp @@ -753,7 +753,7 @@ void FacebookProto::OnPublishPrivateMessage(const JSONNode &root) bool bSuccess = false; CMStringW wszFileName(FORMAT, L"%s\\STK{%S}.png", wszPath.c_str(), stickerId.c_str()); - DWORD dwAttrib = GetFileAttributesW(wszFileName); + uint32_t dwAttrib = GetFileAttributesW(wszFileName); if (dwAttrib == INVALID_FILE_ATTRIBUTES) { wszFileName.Format(L"%s\\STK{%S}.webp", wszPath.c_str(), stickerId.c_str()); dwAttrib = GetFileAttributesW(wszFileName); @@ -890,7 +890,7 @@ void FacebookProto::OnPublishPrivateMessage(const JSONNode &root) } else { // otherwise store a private message PROTORECVEVENT pre = {}; - pre.timestamp = DWORD(_wtoi64(metadata["timestamp"].as_mstring()) / 1000); + pre.timestamp = uint32_t(_wtoi64(metadata["timestamp"].as_mstring()) / 1000); pre.szMessage = (char *)szBody.c_str(); pre.szMsgId = (char *)szId.c_str(); @@ -994,7 +994,7 @@ void FacebookProto::OnPublishReadReceipt(const JSONNode &root) return; } - DWORD timestamp = _wtoi64(root["watermarkTimestampMs"].as_mstring()); + uint32_t timestamp = _wtoi64(root["watermarkTimestampMs"].as_mstring()); for (MEVENT ev = db_event_firstUnread(pUser->hContact); ev != 0; ev = db_event_next(pUser->hContact, ev)) { DBEVENTINFO dbei = {}; if (db_event_get(ev, &dbei)) diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index 14c2b58955..d0f72df6cd 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -298,8 +298,8 @@ void __cdecl GaduProto::avatarrequestthread(void*) void GaduProto::initavatarrequestthread()
{
DWORD exitCode = 0;
-
GetExitCodeThread(pth_avatar.hThread, &exitCode);
+
if (exitCode != STILL_ACTIVE) {
avatar_requests.destroy();
avatar_transfers.destroy();
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index b3f8567b14..7777ae2329 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -26,7 +26,7 @@ #pragma warning(disable : 4189)
////////////////////////////////////////////////////////////
-// Swap bits in DWORD
+// Swap bits in uint32_t
uint32_t swap32(uint32_t x)
{
return (uint32_t)
@@ -436,11 +436,11 @@ retry: && errno == EACCES
&& (m_gaduOptions.autoRecconect || (hostnum < hostcount - 1)))
{
- DWORD dwInterval = getDword(GG_KEY_RECONNINTERVAL, GG_KEYDEF_RECONNINTERVAL);
+ uint32_t dwInterval = getDword(GG_KEY_RECONNINTERVAL, GG_KEYDEF_RECONNINTERVAL);
BOOL bRetry = TRUE;
hConnStopEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
- DWORD dwResult = WaitForSingleObjectEx(hConnStopEvent, dwInterval, TRUE);
+ uint32_t dwResult = WaitForSingleObjectEx(hConnStopEvent, dwInterval, TRUE);
if ((dwResult == WAIT_OBJECT_0 && m_iDesiredStatus == ID_STATUS_OFFLINE)
|| (dwResult == WAIT_IO_COMPLETION && Miranda_IsTerminated()))
bRetry = FALSE;
@@ -547,7 +547,7 @@ retry: // Received ackowledge
case GG_EVENT_ACK:
if (e->event.ack.seq && e->event.ack.recipient) {
- ProtoBroadcastAck(getcontact((DWORD)e->event.ack.recipient, 0, 0, nullptr),
+ ProtoBroadcastAck(getcontact((uint32_t)e->event.ack.recipient, 0, 0, nullptr),
ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)e->event.ack.seq, 0);
}
break;
@@ -904,10 +904,10 @@ retry: {
DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
- dbei.timestamp = (DWORD)e->event.multilogon_msg.time;
+ dbei.timestamp = (uint32_t)e->event.multilogon_msg.time;
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.cbBlob = (DWORD)mir_strlen(e->event.multilogon_msg.message) + 1;
+ dbei.cbBlob = (uint32_t)mir_strlen(e->event.multilogon_msg.message) + 1;
dbei.pBlob = (uint8_t*)e->event.multilogon_msg.message;
db_event_add(getcontact(e->event.multilogon_msg.sender, 1, 0, nullptr), &dbei);
}
@@ -1474,7 +1474,7 @@ MCONTACT GaduProto::getcontact(uin_t uin, int create, int inlist, wchar_t *szNic if (!inlist)
Contact_RemoveFromList(hContact);
- setDword(hContact, GG_KEY_UIN, (DWORD)uin);
+ setDword(hContact, GG_KEY_UIN, (uint32_t)uin);
setWord(hContact, GG_KEY_STATUS, ID_STATUS_OFFLINE);
// If nick specified use it
@@ -1626,12 +1626,12 @@ void GaduProto::changecontactstatus(uin_t uin, int status, const wchar_t *idescr // Store contact ip and port
if (remote_ip)
- setDword(hContact, GG_KEY_CLIENTIP, (DWORD)swap32(remote_ip));
+ setDword(hContact, GG_KEY_CLIENTIP, (uint32_t)swap32(remote_ip));
if (remote_port)
setWord(hContact, GG_KEY_CLIENTPORT, (uint16_t)remote_port);
if (version) {
char sversion[48];
- setDword(hContact, GG_KEY_CLIENTVERSION, (DWORD)version);
+ setDword(hContact, GG_KEY_CLIENTVERSION, (uint32_t)version);
mir_snprintf(sversion, "%sGadu-Gadu %s", (version & 0x00ffffff) > 0x2b ? "Nowe " : "", gg_version2string(version));
setString(hContact, "MirVer", sversion);
}
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp index 6b5cd2c6c4..77e90dea4a 100644 --- a/protocols/Gadu-Gadu/src/dialogs.cpp +++ b/protocols/Gadu-Gadu/src/dialogs.cpp @@ -217,7 +217,7 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, case WM_INITDIALOG: { DBVARIANT dbv; - DWORD num; + uint32_t num; gg = (GaduProto *)lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); @@ -374,7 +374,7 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, if (ret == IDOK) { DBVARIANT dbv; - DWORD num; + uint32_t num; // Show reload required window ShowWindow(GetDlgItem(hwndDlg, IDC_RELOADREQD), SW_SHOW); @@ -774,7 +774,7 @@ INT_PTR CALLBACK gg_acc_mgr_guidlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); TranslateDialogDefault(hwndDlg); - DWORD num = gg->getDword(GG_KEY_UIN, 0); + uint32_t num = gg->getDword(GG_KEY_UIN, 0); if (num) SetDlgItemTextA(hwndDlg, IDC_UIN, ditoa(num)); if (!gg->getString(GG_KEY_PASSWORD, &dbv)) { @@ -806,7 +806,7 @@ INT_PTR CALLBACK gg_acc_mgr_guidlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (ret == IDOK) { DBVARIANT dbv; - DWORD num; + uint32_t num; // Show reload required window ShowWindow(GetDlgItem(hwndDlg, IDC_RELOADREQD), SW_SHOW); diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index e7d512683a..9fd02f204a 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -25,13 +25,13 @@ void GaduProto::dccstart()
{
- DWORD exitCode = 0;
-
if (m_dcc)
return;
// Startup dcc thread
+ DWORD exitCode = 0;
GetExitCodeThread(pth_dcc.hThread, &exitCode);
+
// Check if dcc thread isn't running already
if (exitCode == STILL_ACTIVE)
{
@@ -71,9 +71,9 @@ void GaduProto::dccconnect(uin_t uin) return;
// Read user IP and port
- DWORD ip = swap32(getDword(hContact, GG_KEY_CLIENTIP, 0));
+ uint32_t ip = swap32(getDword(hContact, GG_KEY_CLIENTIP, 0));
uint16_t port = getWord(hContact, GG_KEY_CLIENTPORT, 0);
- DWORD myuin = getDword(GG_KEY_UIN, 0);
+ uint32_t myuin = getDword(GG_KEY_UIN, 0);
// If not port nor ip nor my uin (?) specified
if (!ip || !port || !uin) return;
@@ -151,7 +151,7 @@ void __cdecl GaduProto::dccmainthread(void*) fd_set rd, wd;
int ret;
SOCKET maxfd;
- DWORD tick;
+ uint32_t tick;
char szFilename[MAX_PATH];
while (pth_dcc.dwThreadId && m_dcc)
@@ -915,11 +915,11 @@ HANDLE GaduProto::SendFile(MCONTACT hContact, const wchar_t *, wchar_t** ppszFil filename = mir_u2a(ppszFiles[0]);
// Read user IP and port
- DWORD ip = swap32(getDword(hContact, GG_KEY_CLIENTIP, 0));
+ uint32_t ip = swap32(getDword(hContact, GG_KEY_CLIENTIP, 0));
uint16_t port = getWord(hContact, GG_KEY_CLIENTPORT, 0);
uin_t myuin = getDword(GG_KEY_UIN, 0);
uin_t uin = getDword(hContact, GG_KEY_UIN, 0);
- DWORD ver = getDword(hContact, GG_KEY_CLIENTVERSION, 0);
+ uint32_t ver = getDword(hContact, GG_KEY_CLIENTVERSION, 0);
// Use DCC7 if a contact is using at least version 7.6 or unknown version
if ((ver & 0x00ffffff) >= 0x29 || !ver) {
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 1ac8dae385..eb72b39041 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -157,7 +157,7 @@ const wchar_t *http_error_string(int h) //////////////////////////////////////////////////////////
// Cleanups from last plugin
//
-void GaduProto::cleanuplastplugin(DWORD version)
+void GaduProto::cleanuplastplugin(uint32_t version)
{
// Store current plugin version
setDword(GG_PLUGINVERSION, pluginInfoEx.version);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 42a3bcc935..09e03f38a6 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -74,7 +74,7 @@ GaduProto::GaduProto(const char *pszProtoName, const wchar_t *tszUserName) : mir_snwprintf(szPath, L"%s\\%s\\ImageCache", (wchar_t*)VARSW(L"%miranda_userdata%"), m_tszUserName);
hImagesFolder = FoldersRegisterCustomPathW(LPGEN("Images"), m_szModuleName, szPath, m_tszUserName);
- DWORD pluginVersion = getDword(GG_PLUGINVERSION, 0);
+ uint32_t pluginVersion = getDword(GG_PLUGINVERSION, 0);
if (pluginVersion < pluginInfoEx.version)
cleanuplastplugin(pluginVersion);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h index 4d6792cad6..8bb112ebc6 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.h +++ b/protocols/Gadu-Gadu/src/gg_proto.h @@ -97,7 +97,7 @@ struct GaduProto : public PROTO<GaduProto> #endif
void gg_EnterCriticalSection(CRITICAL_SECTION* mutex, char* callingFunction, int sectionNumber, char* mutexName, int logging);
void gg_LeaveCriticalSection(CRITICAL_SECTION* mutex, char* callingFunction, int sectionNumber, int returnNumber, char* mutexName, int logging);
- void gg_sleep(DWORD miliseconds, BOOL alterable, char* callingFunction, int sleepNumber, int logging);
+ void gg_sleep(uint32_t miliseconds, BOOL alterable, char* callingFunction, int sleepNumber, int logging);
/* Global GG functions */
void notifyuser(MCONTACT hContact, int refresh);
@@ -108,7 +108,7 @@ struct GaduProto : public PROTO<GaduProto> int refreshstatus(int status);
void broadcastnewstatus(int newStatus);
- void cleanuplastplugin(DWORD version);
+ void cleanuplastplugin(uint32_t version);
void notifyall();
void changecontactstatus(uin_t uin, int status, const wchar_t *idescr, int time, uint32_t remote_ip, uint16_t remote_port, uint32_t version);
wchar_t *getstatusmsg(int status);
@@ -296,9 +296,9 @@ inline void GaduProto::gg_LeaveCriticalSection(CRITICAL_SECTION* mutex, char *, }
#ifdef DEBUGMODE
-inline void GaduProto::gg_sleep(DWORD miliseconds, BOOL alterable, char* callingFunction, int sleepNumber, int logging) {
+inline void GaduProto::gg_sleep(uint32_t miliseconds, BOOL alterable, char* callingFunction, int sleepNumber, int logging) {
#else
-inline void GaduProto::gg_sleep(DWORD miliseconds, BOOL alterable, char* callingFunction, int, int) {
+inline void GaduProto::gg_sleep(uint32_t miliseconds, BOOL alterable, char* callingFunction, int, int) {
#endif
SleepEx(miliseconds, alterable);
#ifdef DEBUGMODE
diff --git a/protocols/GmailNotifier/src/notify.cpp b/protocols/GmailNotifier/src/notify.cpp index c09988f12f..40f92b6ad9 100644 --- a/protocols/GmailNotifier/src/notify.cpp +++ b/protocols/GmailNotifier/src/notify.cpp @@ -6,7 +6,7 @@ static void __cdecl Login_ThreadFunc(Account *curAcc) return; HANDLE hTempFile; - DWORD dwBytesWritten, dwBufSize = 1024; + DWORD dwBytesWritten, dwBufSize = 1024; char szTempName[MAX_PATH]; char buffer[1024]; char *str_temp; @@ -41,7 +41,7 @@ static void __cdecl Login_ThreadFunc(Account *curAcc) mir_strcat(buffer, "><input type=hidden name=password value="); mir_strcat(buffer, curAcc->pass); mir_strcat(buffer, "></form></body>"); - WriteFile(hTempFile, buffer, (DWORD)mir_strlen(buffer), &dwBytesWritten, nullptr); + WriteFile(hTempFile, buffer, (uint32_t)mir_strlen(buffer), &dwBytesWritten, nullptr); CloseHandle(hTempFile); mir_strcat(lpPathBuffer, szTempName); } @@ -149,7 +149,7 @@ void NotifyUser(Account *curAcc) resultLink *prst = curAcc->results.next; for (int i = 0; i < newMails; i++) { - dbei.cbBlob = (DWORD)mir_strlen(prst->content) + 1; + dbei.cbBlob = (uint32_t)mir_strlen(prst->content) + 1; dbei.pBlob = (uint8_t*)prst->content; db_event_add(curAcc->hContact, &dbei); prst = prst->next; diff --git a/protocols/ICQ-WIM/src/options.cpp b/protocols/ICQ-WIM/src/options.cpp index 5855babd82..8e0b8e3e83 100644 --- a/protocols/ICQ-WIM/src/options.cpp +++ b/protocols/ICQ-WIM/src/options.cpp @@ -320,7 +320,7 @@ public: bool OnInitDialog() override { if (cmbStatus1.GetHwnd()) { - for (DWORD iStatus = ID_STATUS_OFFLINE; iStatus <= ID_STATUS_MAX; iStatus++) { + for (uint32_t iStatus = ID_STATUS_OFFLINE; iStatus <= ID_STATUS_MAX; iStatus++) { int idx = cmbStatus1.AddString(Clist_GetStatusModeDescription(iStatus, 0)); cmbStatus1.SetItemData(idx, iStatus); if (iStatus == m_proto->m_iStatus1) diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h index 0c57effe4f..3268b522a8 100644 --- a/protocols/ICQ-WIM/src/proto.h +++ b/protocols/ICQ-WIM/src/proto.h @@ -72,7 +72,7 @@ enum ChatMenuItems struct IcqFileInfo { - IcqFileInfo(const std::string &pszUrl, const CMStringW &pwszDescr, DWORD dwSize) : + IcqFileInfo(const std::string &pszUrl, const CMStringW &pwszDescr, uint32_t dwSize) : szUrl(pszUrl.c_str()), wszDescr(pwszDescr), dwFileSize(dwSize) @@ -80,7 +80,7 @@ struct IcqFileInfo CMStringA szUrl; CMStringW wszDescr; - DWORD dwFileSize; + uint32_t dwFileSize; bool bIsSticker = false; }; @@ -194,7 +194,7 @@ struct IcqFileTransfer : public MZeroedObject pReq->AddHeader("Content-Type", "application/octet-stream"); pReq->AddHeader("Content-Disposition", CMStringA(FORMAT, "attachment; filename=\"%s\"", T2Utf(m_wszShortName).get())); - DWORD dwPortion = pfts.currentFileSize - pfts.currentFileProgress; + uint32_t dwPortion = pfts.currentFileSize - pfts.currentFileProgress; if (dwPortion > 1000000) dwPortion = 1000000; @@ -463,10 +463,10 @@ public: CMOption<uint8_t> m_bUseTrayIcon; // use tray icon notifications CMOption<uint8_t> m_bErrorPopups; // display popups with errors CMOption<uint8_t> m_bLaunchMailbox; // launch browser to view email - CMOption<DWORD> m_iTimeDiff1; // set this status to m_iStatus1 after this interval of secs - CMOption<DWORD> m_iStatus1; - CMOption<DWORD> m_iTimeDiff2; // set this status to m_iStatus2 after this interval of secs - CMOption<DWORD> m_iStatus2; + CMOption<uint32_t> m_iTimeDiff1; // set this status to m_iStatus1 after this interval of secs + CMOption<uint32_t> m_iStatus1; + CMOption<uint32_t> m_iTimeDiff2; // set this status to m_iStatus2 after this interval of secs + CMOption<uint32_t> m_iStatus2; void CheckStatus(void); CMStringW GetUserId(MCONTACT); diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index f30ec313eb..4a9851eb4b 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -451,7 +451,7 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo DB::AUTH_BLOB blob(hContact, nick, nullptr, nullptr, id, nullptr); PROTORECVEVENT pre = {}; - pre.timestamp = (DWORD)time(0); + pre.timestamp = (uint32_t)time(0); pre.lParam = blob.size(); pre.szMessage = blob; ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&pre); diff --git a/protocols/ICQCorp/src/options.cpp b/protocols/ICQCorp/src/options.cpp index 16fc69713a..4f940aa1eb 100644 --- a/protocols/ICQCorp/src/options.cpp +++ b/protocols/ICQCorp/src/options.cpp @@ -45,7 +45,7 @@ static INT_PTR CALLBACK icqOptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- g_plugin.setDword("UIN", (DWORD)GetDlgItemInt(hWnd, IDC_OPT_UIN, nullptr, FALSE));
+ g_plugin.setDword("UIN", (uint32_t)GetDlgItemInt(hWnd, IDC_OPT_UIN, nullptr, FALSE));
GetDlgItemTextA(hWnd, IDC_OPT_PASSWORD, str, sizeof(str));
g_plugin.setString("Password", str);
GetDlgItemTextA(hWnd, IDC_OPT_SERVER, str, sizeof(str));
diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp index 48afd2f717..8de3587c82 100644 --- a/protocols/ICQCorp/src/protocol.cpp +++ b/protocols/ICQCorp/src/protocol.cpp @@ -2104,11 +2104,11 @@ void ICQ::addFileReq(ICQUser *u, char *m, char *filename, unsigned long size, un icqTransfers.push_back(transfer);
// Send chain event
- char *szBlob = new char[sizeof(DWORD) + mir_strlen(filename) + mir_strlen(m) + 2];
+ char *szBlob = new char[sizeof(uint32_t) + mir_strlen(filename) + mir_strlen(m) + 2];
*(PDWORD)szBlob = (UINT_PTR)transfer;
- mir_strcpy(szBlob + sizeof(DWORD), filename);
- mir_strcpy(szBlob + sizeof(DWORD) + mir_strlen(filename) + 1, m);
+ mir_strcpy(szBlob + sizeof(uint32_t), filename);
+ mir_strcpy(szBlob + sizeof(uint32_t) + mir_strlen(filename) + 1, m);
PROTORECVEVENT pre;
pre.flags = 0;
diff --git a/protocols/ICQCorp/src/protocol.h b/protocols/ICQCorp/src/protocol.h index c939b2bd46..4e23d7781c 100644 --- a/protocols/ICQCorp/src/protocol.h +++ b/protocols/ICQCorp/src/protocol.h @@ -133,7 +133,7 @@ const unsigned int WM_NETEVENT_TRANSFER = WM_USER + 4; typedef struct { //extended search result structure, used for all searches
PROTOSEARCHRESULT hdr;
- DWORD uin;
+ uint32_t uin;
uint8_t auth;
} ICQSEARCHRESULT;
diff --git a/protocols/ICQCorp/src/services.cpp b/protocols/ICQCorp/src/services.cpp index 825f277f9d..2b1ae872c4 100644 --- a/protocols/ICQCorp/src/services.cpp +++ b/protocols/ICQCorp/src/services.cpp @@ -201,7 +201,7 @@ static INT_PTR icqRecvMessage(WPARAM, LPARAM lParam) if (pre->flags & PREF_CREATEREAD)
dbei.flags |= DBEF_READ;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.cbBlob = (DWORD)mir_strlen(szMsg) + 1;
+ dbei.cbBlob = (uint32_t)mir_strlen(szMsg) + 1;
dbei.pBlob = (uint8_t*)szMsg.get();
db_event_add(ccs->hContact, &dbei);
return 0;
@@ -365,7 +365,7 @@ static INT_PTR icqRecvFile(WPARAM, LPARAM lParam) Contact_Hide(ccs->hContact, false);
PROTORECVEVENT *pre = (PROTORECVEVENT *)ccs->lParam;
- char *szFile = pre->szMessage + sizeof(DWORD);
+ char *szFile = pre->szMessage + sizeof(uint32_t);
char *szDesc = szFile + mir_strlen(szFile) + 1;
DBEVENTINFO dbei = {};
@@ -373,7 +373,7 @@ static INT_PTR icqRecvFile(WPARAM, LPARAM lParam) dbei.timestamp = pre->timestamp;
dbei.flags = pre->flags & (PREF_CREATEREAD ? DBEF_READ : 0);
dbei.eventType = EVENTTYPE_FILE;
- dbei.cbBlob = sizeof(DWORD) + (DWORD)mir_strlen(szFile) + (DWORD)mir_strlen(szDesc) + 2;
+ dbei.cbBlob = sizeof(uint32_t) + (uint32_t)mir_strlen(szFile) + (uint32_t)mir_strlen(szDesc) + 2;
dbei.pBlob = (uint8_t*)pre->szMessage;
db_event_add(ccs->hContact, &dbei);
diff --git a/protocols/ICQCorp/src/transfer.cpp b/protocols/ICQCorp/src/transfer.cpp index a9f7619e2b..82ca64b879 100644 --- a/protocols/ICQCorp/src/transfer.cpp +++ b/protocols/ICQCorp/src/transfer.cpp @@ -23,7 +23,7 @@ std::vector <ICQTransfer *> icqTransfers; ///////////////////////////////////////////////////////////////////////////////
-void WINAPI transferTimerProc(HWND, UINT, UINT_PTR hTimer, DWORD)
+static void WINAPI transferTimerProc(HWND, UINT, UINT_PTR hTimer, DWORD)
{
KillTimer(nullptr, hTimer);
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index 5e73188509..5164ea6ffa 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -43,7 +43,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMStringW& name, const CMStringW& hostmas DCCINFO *pdci = new DCCINFO;
pdci->sHostmask = hostmask;
pdci->hContact = hContact;
- pdci->dwAdr = (DWORD)adr;
+ pdci->dwAdr = (uint32_t)adr;
pdci->iPort = port;
pdci->iType = DCC_CHAT;
pdci->bSender = false;
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 8e5441809e..c9014b413f 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -226,10 +226,10 @@ int CIrcProto::AddOutgoingMessageToDB(MCONTACT hContact, const wchar_t *msg) DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.timestamp = (DWORD)time(0);
+ dbei.timestamp = (uint32_t)time(0);
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.pBlob = (uint8_t*)mir_utf8encodeW(S);
- dbei.cbBlob = (DWORD)mir_strlen((char*)dbei.pBlob) + 1;
+ dbei.cbBlob = (uint32_t)mir_strlen((char*)dbei.pBlob) + 1;
db_event_add(hContact, &dbei);
mir_free(dbei.pBlob);
return 1;
@@ -689,7 +689,7 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage *pmsg) MCONTACT hContact = CList_AddContact(&user, false, true);
PROTORECVEVENT pre = { 0 };
- pre.timestamp = (DWORD)time(0);
+ pre.timestamp = (uint32_t)time(0);
pre.szMessage = mir_utf8encodeW(mess);
setWString(hContact, "User", pmsg->prefix.sUser);
setWString(hContact, "Host", pmsg->prefix.sHost);
@@ -840,7 +840,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage *pmsg) // components of a dcc message
CMStringW sFile = L"";
- DWORD dwAdr = 0;
+ uint32_t dwAdr = 0;
int iPort = 0;
unsigned __int64 dwSize = 0;
CMStringW sToken = L"";
@@ -1142,7 +1142,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage *pmsg) PROTORECVFILE pre = { 0 };
pre.dwFlags = PRFF_UNICODE;
- pre.timestamp = (DWORD)time(0);
+ pre.timestamp = (uint32_t)time(0);
pre.fileCount = 1;
pre.files.w = &tszTemp;
pre.lParam = (LPARAM)di;
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index 67625b3ccd..47ecfb62ac 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -251,7 +251,7 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info) void CIrcProto::Disconnect(void) { - static const DWORD dwServerTimeout = 5 * 1000; + static const uint32_t dwServerTimeout = 5 * 1000; if (con == nullptr) return; @@ -805,7 +805,7 @@ void __cdecl CDccSession::ConnectProc(void *pparam) } // small function to setup the address and port of the remote computer fror passive filetransfers -void CDccSession::SetupPassive(DWORD adress, DWORD port) +void CDccSession::SetupPassive(uint32_t adress, uint32_t port) { di->dwAdr = adress; di->iPort = (int)port; @@ -975,7 +975,7 @@ int CDccSession::SetupConnection() } // called by netlib for incoming connections on a listening socket (chat/filetransfer) -int CDccSession::IncomingConnection(HNETLIBCONN hConnection, DWORD dwIP) +int CDccSession::IncomingConnection(HNETLIBCONN hConnection, uint32_t dwIP) { con = hConnection; if (con == nullptr) { @@ -1057,11 +1057,11 @@ void CDccSession::DoSendFile() tLastActivity = time(0); // create a packet receiver to handle receiving ack's from the remote computer. - HANDLE hPackrcver = Netlib_CreatePacketReceiver(con, sizeof(DWORD)); + HANDLE hPackrcver = Netlib_CreatePacketReceiver(con, sizeof(uint32_t)); NETLIBPACKETRECVER npr = {}; npr.dwTimeout = 60 * 1000; - npr.bufferSize = sizeof(DWORD); + npr.bufferSize = sizeof(uint32_t); // until the connection is dropped it will spin around in this while() loop while (con) { @@ -1082,17 +1082,17 @@ void CDccSession::DoSendFile() // block connection and receive ack's from remote computer (if applicable) if (m_proto->m_DCCMode == 0) { - DWORD dwRead = 0; - DWORD dwPacket = NULL; + uint32_t dwRead = 0; + uint32_t dwPacket = NULL; do { dwRead = Netlib_GetMorePackets(hPackrcver, &npr); - npr.bytesUsed = sizeof(DWORD); + npr.bytesUsed = sizeof(uint32_t); if (dwRead <= 0) break; // connection closed, or a timeout occurred. - dwPacket = *(DWORD*)npr.buffer; + dwPacket = *(uint32_t*)npr.buffer; dwLastAck = ntohl(dwPacket); } @@ -1103,16 +1103,16 @@ void CDccSession::DoSendFile() } if (m_proto->m_DCCMode == 1) { - DWORD dwRead = 0; - DWORD dwPacket = 0; + uint32_t dwRead = 0; + uint32_t dwPacket = 0; do { dwRead = Netlib_GetMorePackets(hPackrcver, &npr); - npr.bytesUsed = sizeof(DWORD); + npr.bytesUsed = sizeof(uint32_t); if (dwRead <= 0) break; // connection closed, or a timeout occurred. - dwPacket = *(DWORD*)npr.buffer; + dwPacket = *(uint32_t*)npr.buffer; dwLastAck = ntohl(dwPacket); } while (con && (di->dwSize != dwTotal @@ -1213,9 +1213,9 @@ void CDccSession::DoReceiveFile() // this snippet sends out an ack for every 4 kb received in send ahead // or every packet for normal mode if (!di->bTurbo) { - DWORD no = dwTotal; + uint32_t no = dwTotal; no = htonl(no); - NLSend((unsigned char *)&no, sizeof(DWORD)); + NLSend((unsigned char *)&no, sizeof(uint32_t)); dwLastAck = dwTotal; } else dwLastAck = dwTotal; @@ -1293,7 +1293,7 @@ void CDccSession::DoChatReceive() if (*pStart) { // send it off to some messaging module PROTORECVEVENT pre = { 0 }; - pre.timestamp = (DWORD)time(0); + pre.timestamp = (uint32_t)time(0); pre.szMessage = pStart; ProtoChainRecvMsg(di->hContact, &pre); } @@ -1340,7 +1340,7 @@ VOID CALLBACK DCCTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) } // helper function for incoming dcc connections. -void DoIncomingDcc(HNETLIBCONN hConnection, DWORD dwRemoteIP, void * p1) +void DoIncomingDcc(HNETLIBCONN hConnection, uint32_t dwRemoteIP, void * p1) { CDccSession *dcc = (CDccSession*)p1; dcc->IncomingConnection(hConnection, dwRemoteIP); @@ -1348,7 +1348,7 @@ void DoIncomingDcc(HNETLIBCONN hConnection, DWORD dwRemoteIP, void * p1) // ident server -void DoIdent(HNETLIBCONN hConnection, DWORD, void* extra) +void DoIdent(HNETLIBCONN hConnection, uint32_t, void* extra) { CIrcProto *ppro = (CIrcProto*)extra; diff --git a/protocols/IRCG/src/irclib.h b/protocols/IRCG/src/irclib.h index 7b4524f16e..fee6eca5a7 100644 --- a/protocols/IRCG/src/irclib.h +++ b/protocols/IRCG/src/irclib.h @@ -24,8 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma warning (disable: 4786)
-void DoIdent(HNETLIBCONN hConnection, DWORD dwRemoteIP, void* extra);
-void DoIncomingDcc(HNETLIBCONN hConnection, DWORD dwRemoteIP, void* extra);
+void DoIdent(HNETLIBCONN hConnection, uint32_t dwRemoteIP, void* extra);
+void DoIncomingDcc(HNETLIBCONN hConnection, uint32_t dwRemoteIP, void* extra);
unsigned long ConvertIPToInteger(char * IP);
char* ConvertIntegerToIP(unsigned long int_ip_addr);
@@ -41,9 +41,9 @@ const int UNDERLINE = 0x1F; struct DCCINFO : public MZeroedObject
{
- DWORD dwAdr;
+ uint32_t dwAdr;
unsigned __int64 dwSize;
- DWORD iType;
+ uint32_t iType;
CMStringW sToken;
int iPort;
BOOL bTurbo;
@@ -167,9 +167,9 @@ public: DCCINFO* di; // details regarding the filetrasnfer
int Connect();
- void SetupPassive( DWORD adr, DWORD port );
+ void SetupPassive( uint32_t adr, uint32_t port );
int SendStuff(const wchar_t* fmt);
- int IncomingConnection(HNETLIBCONN hConnection, DWORD dwIP);
+ int IncomingConnection(HNETLIBCONN hConnection, uint32_t dwIP);
int Disconnect();
};
diff --git a/protocols/IRCG/src/ircproto.h b/protocols/IRCG/src/ircproto.h index efc465f31f..5804e3631a 100644 --- a/protocols/IRCG/src/ircproto.h +++ b/protocols/IRCG/src/ircproto.h @@ -169,8 +169,8 @@ struct CIrcProto : public PROTO<CIrcProto> SESSION_INFO *m_pServer; int m_portCount; - DWORD m_bConnectRequested; - DWORD m_bConnectThreadRunning; + uint32_t m_bConnectRequested; + uint32_t m_bConnectThreadRunning; HGENMENU hMenuQuick, hMenuServer, hMenuJoin, hMenuNick, hMenuList; HNETLIBUSER hNetlibDCC; diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 9961f0be81..8d0d8961db 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -48,7 +48,7 @@ void CIrcProto::ReadSettings(TDbSetting *sets, int count) *(uint16_t*)ptr = getWord(p->name, p->defValue);
break;
case DBVT_DWORD:
- *(DWORD*)ptr = getDword(p->name, p->defValue);
+ *(uint32_t*)ptr = getDword(p->name, p->defValue);
break;
case DBVT_ASCIIZ:
if (!getString(p->name, &dbv)) {
@@ -101,7 +101,7 @@ void CIrcProto::WriteSettings(TDbSetting *sets, int count) switch (p->type) {
case DBVT_BYTE: setByte(p->name, *(uint8_t*)ptr); break;
case DBVT_WORD: setWord(p->name, *(uint16_t*)ptr); break;
- case DBVT_DWORD: setDword(p->name, *(DWORD*)ptr); break;
+ case DBVT_DWORD: setDword(p->name, *(uint32_t*)ptr); break;
case DBVT_ASCIIZ:
if (p->size == -1)
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp index 133a8f9346..b1d3817489 100644 --- a/protocols/IRCG/src/tools.cpp +++ b/protocols/IRCG/src/tools.cpp @@ -123,7 +123,7 @@ void __stdcall RemoveLinebreaks(CMStringW &Message) char* __stdcall IrcLoadFile(wchar_t* szPath)
{
char * szContainer = nullptr;
- DWORD dwSiz = 0;
+ uint32_t dwSiz = 0;
FILE *hFile = _wfopen(szPath, L"rb");
if (hFile != nullptr) {
fseek(hFile, 0, SEEK_END); // seek to end
diff --git a/protocols/JabberG/src/jabber_api.cpp b/protocols/JabberG/src/jabber_api.cpp index aabf62e222..90be2f0c9e 100644 --- a/protocols/JabberG/src/jabber_api.cpp +++ b/protocols/JabberG/src/jabber_api.cpp @@ -35,7 +35,7 @@ INT_PTR __cdecl CJabberProto::JabberGetApi(WPARAM, LPARAM lParam) return 0;
}
-DWORD CJabberProto::GetFlags() const
+uint32_t CJabberProto::GetFlags() const
{
return JIF_UNICODE;
}
@@ -45,7 +45,7 @@ int CJabberProto::GetVersion() const return 1;
}
-DWORD CJabberProto::GetJabberVersion() const
+uint32_t CJabberProto::GetJabberVersion() const
{
return PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM);
}
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp index ddbb71ae94..b582c6bbd1 100644 --- a/protocols/JabberG/src/jabber_archive.cpp +++ b/protocols/JabberG/src/jabber_archive.cpp @@ -78,7 +78,7 @@ void CJabberProto::OnIqResultGetCollectionList(const TiXmlElement *iqNode, CJabb /////////////////////////////////////////////////////////////////////////////////////////
-static DWORD dwPreviousTimeStamp = -1;
+static uint32_t dwPreviousTimeStamp = -1;
static MCONTACT hPreviousContact = INVALID_CONTACT_ID;
static MEVENT hPreviousDbEvent = 0;
@@ -92,7 +92,7 @@ bool IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei) DBEVENTINFO dbeiExisting = {};
db_event_get(hExistingDbEvent, &dbeiExisting);
- DWORD dwEventTimeStamp = dbeiExisting.timestamp;
+ uint32_t dwEventTimeStamp = dbeiExisting.timestamp;
// compare with last timestamp
if (dbei.timestamp > dwEventTimeStamp) {
@@ -255,7 +255,7 @@ void CJabberProto::OnIqResultGetCollection(const TiXmlElement *iqNode, CJabberIq DBEVENTINFO dbei = {};
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.szModule = m_szModuleName;
- dbei.cbBlob = (DWORD)mir_strlen(tszBody) + 1;
+ dbei.cbBlob = (uint32_t)mir_strlen(tszBody) + 1;
dbei.flags = DBEF_READ + DBEF_UTF + from;
dbei.pBlob = (uint8_t*)tszBody;
dbei.timestamp = tmStart + atol(tszSecs);
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index c9c9088aca..dd51482694 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -82,7 +82,7 @@ void CJabberProto::IqResultProxyDiscovery(const TiXmlElement *iqNode, CJabberIqI SetEvent(jbt->hProxyEvent);
}
-void JabberByteSendConnection(HNETLIBCONN hConn, DWORD /*dwRemoteIP*/, void* extra)
+void JabberByteSendConnection(HNETLIBCONN hConn, uint32_t /*dwRemoteIP*/, void* extra)
{
CJabberProto *ppro = (CJabberProto*)extra;
JABBER_BYTE_TRANSFER *jbt;
@@ -365,7 +365,7 @@ int CJabberProto::ByteSendParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jbt, ch // 03-03 address type (1=IPv4 address)
// 04-07 bnd.addr server bound address
// 08-09 bnd.port server bound port
- if (datalen == 47 && *((DWORD*)buffer) == 0x03000105 && buffer[4] == 40 && *((uint16_t*)(buffer + 45)) == 0) {
+ if (datalen == 47 && *((uint32_t*)buffer) == 0x03000105 && buffer[4] == 40 && *((uint16_t*)(buffer + 45)) == 0) {
ptrA szInitiatorJid(JabberPrepareJid(jbt->srcJID));
ptrA szTargetJid(JabberPrepareJid(jbt->dstJID));
CMStringA szAuthString(FORMAT, "%s%s%s", jbt->sid, szInitiatorJid.get(), szTargetJid.get());
@@ -499,7 +499,7 @@ int CJabberProto::ByteSendProxyParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jb if (datalen == 2 && buffer[0] == 5 && buffer[1] == 0) {
uint8_t data[47];
memset(data, 0, sizeof(data));
- *((DWORD*)data) = 0x03000105;
+ *((uint32_t*)data) = 0x03000105;
data[4] = 40;
char szAuthString[256];
@@ -686,7 +686,7 @@ int CJabberProto::ByteReceiveParse(HNETLIBCONN hConn, JABBER_BYTE_TRANSFER *jbt, if (datalen == 2 && buffer[0] == 5 && buffer[1] == 0) {
uint8_t data[47];
memset(data, 0, sizeof(data));
- *((DWORD*)data) = 0x03000105;
+ *((uint32_t*)data) = 0x03000105;
data[4] = 40;
CMStringA szAuthString(FORMAT, "%s%s%s", jbt->sid, ptrA(JabberPrepareJid(jbt->srcJID)).get(), ptrA(JabberPrepareJid(jbt->dstJID)).get());
diff --git a/protocols/JabberG/src/jabber_caps.h b/protocols/JabberG/src/jabber_caps.h index ce3303d2bf..e0fc72d37c 100755 --- a/protocols/JabberG/src/jabber_caps.h +++ b/protocols/JabberG/src/jabber_caps.h @@ -268,7 +268,7 @@ class CJabberClientPartialCaps ptrA m_szHash, m_szOs, m_szOsVer, m_szSoft, m_szSoftVer, m_szSoftMir;
JabberCapsBits m_jcbCaps = JABBER_RESOURCE_CAPS_UNINIT;
int m_nIqId = -1, m_iTime;
- DWORD m_dwRequestTime = 0;
+ uint32_t m_dwRequestTime = 0;
class CJabberClientCaps *m_parent;
CJabberClientPartialCaps *m_pNext = nullptr;
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 8f1cbf7b50..9c3df7a564 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -336,7 +336,7 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, const TiXmlElement * /////////////////////////////////////////////////////////////////////////////////////////
// Context menu hooks
-static gc_item *sttFindGcMenuItem(int nItems, gc_item *items, DWORD id)
+static gc_item *sttFindGcMenuItem(int nItems, gc_item *items, uint32_t id)
{
for (int i = 0; i < nItems; i++)
if (items[i].dwID == id)
@@ -345,27 +345,27 @@ static gc_item *sttFindGcMenuItem(int nItems, gc_item *items, DWORD id) return nullptr;
}
-static void sttSetupGcMenuItem(int nItems, gc_item *items, DWORD id, bool disabled)
+static void sttSetupGcMenuItem(int nItems, gc_item *items, uint32_t id, bool disabled)
{
for (int i = 0; i < nItems; i++)
if (!id || (items[i].dwID == id))
items[i].bDisabled = disabled;
}
-static void sttShowGcMenuItem(int nItems, gc_item *items, DWORD id, int type)
+static void sttShowGcMenuItem(int nItems, gc_item *items, uint32_t id, int type)
{
for (int i = 0; i < nItems; i++)
if (!id || (items[i].dwID == id))
items[i].uType = type;
}
-static void sttSetupGcMenuItems(int nItems, gc_item *items, DWORD *ids, bool disabled)
+static void sttSetupGcMenuItems(int nItems, gc_item *items, uint32_t *ids, bool disabled)
{
for (; *ids; ++ids)
sttSetupGcMenuItem(nItems, items, *ids, disabled);
}
-static void sttShowGcMenuItems(int nItems, gc_item *items, DWORD *ids, int type)
+static void sttShowGcMenuItems(int nItems, gc_item *items, uint32_t *ids, int type)
{
for (; *ids; ++ids)
sttShowGcMenuItem(nItems, items, *ids, type);
@@ -492,9 +492,9 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam) if (gcmi->Type == MENU_ON_LOG) {
static wchar_t url_buf[1024] = { 0 };
- static DWORD sttModeratorItems[] = { IDM_LST_PARTICIPANT, 0 };
- static DWORD sttAdminItems[] = { IDM_LST_MODERATOR, IDM_LST_MEMBER, IDM_LST_ADMIN, IDM_LST_OWNER, IDM_LST_BAN, 0 };
- static DWORD sttOwnerItems[] = { IDM_CONFIG, IDM_DESTROY, 0 };
+ static uint32_t sttModeratorItems[] = { IDM_LST_PARTICIPANT, 0 };
+ static uint32_t sttAdminItems[] = { IDM_LST_MODERATOR, IDM_LST_MEMBER, IDM_LST_ADMIN, IDM_LST_OWNER, IDM_LST_BAN, 0 };
+ static uint32_t sttOwnerItems[] = { IDM_CONFIG, IDM_DESTROY, 0 };
sttSetupGcMenuItem(_countof(sttLogListItems), sttLogListItems, 0, FALSE);
@@ -531,7 +531,7 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam) Chat_AddMenuItems(gcmi->hMenu, _countof(sttLogListItems), sttLogListItems, &g_plugin);
}
else if (gcmi->Type == MENU_ON_NICKLIST) {
- static DWORD sttRJidItems[] = { IDM_RJID_VCARD, IDM_RJID_ADD, IDM_RJID_COPY, 0 };
+ static uint32_t sttRJidItems[] = { IDM_RJID_VCARD, IDM_RJID_ADD, IDM_RJID_COPY, 0 };
if (me && him) {
int i, idx;
@@ -942,7 +942,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* // 1 kick per second, prevents crashes...
enum { BAN_KICK_INTERVAL = 1000 };
- static DWORD dwLastBanKickTime = 0;
+ static uint32_t dwLastBanKickTime = 0;
CMStringW szBuffer, szTitle;
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp index 31b44d4414..e78dec7564 100644 --- a/protocols/JabberG/src/jabber_console.cpp +++ b/protocols/JabberG/src/jabber_console.cpp @@ -70,9 +70,9 @@ static void sttEmptyBuf(StringBuf *buf); #define RTF_ENDPLAINXML "\\par"
#define RTF_SEPARATOR "\\sl-1\\slmult0\\highlight5\\cf5\\-\\par\\sl0"
-static void sttRtfAppendXml(StringBuf *buf, const TiXmlElement *node, DWORD flags, int indent);
+static void sttRtfAppendXml(StringBuf *buf, const TiXmlElement *node, uint32_t flags, int indent);
-void CJabberProto::OnConsoleProcessXml(const TiXmlElement *node, DWORD flags)
+void CJabberProto::OnConsoleProcessXml(const TiXmlElement *node, uint32_t flags)
{
if (node && m_pDlgConsole) {
if (node->Name()) {
@@ -93,7 +93,7 @@ void CJabberProto::OnConsoleProcessXml(const TiXmlElement *node, DWORD flags) }
}
-bool CJabberProto::RecursiveCheckFilter(const TiXmlElement *node, DWORD flags)
+bool CJabberProto::RecursiveCheckFilter(const TiXmlElement *node, uint32_t flags)
{
for (auto *p = node->FirstAttribute(); p; p = p->Next())
if (JabberStrIStr(Utf2T(p->Value()), m_filterInfo.pattern))
@@ -106,7 +106,7 @@ bool CJabberProto::RecursiveCheckFilter(const TiXmlElement *node, DWORD flags) return false;
}
-bool CJabberProto::FilterXml(const TiXmlElement *node, DWORD flags)
+bool CJabberProto::FilterXml(const TiXmlElement *node, uint32_t flags)
{
if (!m_filterInfo.msg && !mir_strcmp(node->Name(), "message")) return false;
if (!m_filterInfo.presence && !mir_strcmp(node->Name(), "presence")) return false;
@@ -181,7 +181,7 @@ static void sttEmptyBuf(StringBuf *buf) buf->offset = 0;
}
-static void sttRtfAppendXml(StringBuf *buf, const TiXmlElement *node, DWORD flags, int indent)
+static void sttRtfAppendXml(StringBuf *buf, const TiXmlElement *node, uint32_t flags, int indent)
{
char indentLevel[128];
mir_snprintf(indentLevel, RTF_INDENT_FMT, (int)(indent * 200));
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index 497cc29483..f212157dec 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -43,11 +43,11 @@ enum #define REFRESH_TIMEOUT 500
#define REFRESH_TIMER 1607
-static DWORD sttLastRefresh = 0;
+static uint32_t sttLastRefresh = 0;
#define AUTODISCO_TIMEOUT 500
#define AUTODISCO_TIMER 1608
-static DWORD sttLastAutoDisco = 0;
+static uint32_t sttLastAutoDisco = 0;
enum { SD_OVERLAY_NONE, SD_OVERLAY_FAIL, SD_OVERLAY_PROGRESS, SD_OVERLAY_REGISTERED };
@@ -509,7 +509,7 @@ struct char *feature;
wchar_t *title;
int action;
- DWORD flags;
+ uint32_t flags;
}
static items[] =
{
diff --git a/protocols/JabberG/src/jabber_disco.h b/protocols/JabberG/src/jabber_disco.h index 9ea232b38c..3397067e58 100644 --- a/protocols/JabberG/src/jabber_disco.h +++ b/protocols/JabberG/src/jabber_disco.h @@ -125,8 +125,8 @@ protected: CJabberSDFeature *m_pFeatures;
CJabberSDNode *m_pNext;
CJabberSDNode *m_pChild;
- DWORD m_dwInfoRequestTime;
- DWORD m_dwItemsRequestTime;
+ uint32_t m_dwInfoRequestTime;
+ uint32_t m_dwItemsRequestTime;
int m_nInfoRequestId;
int m_nItemsRequestId;
HTREELISTITEM m_hTreeItem;
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index 539f015e2c..1c91717c3d 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -170,7 +170,7 @@ int CJabberProto::FileReceiveParse(filetransfer *ft, char* buffer, int datalen) return num;
}
-void JabberFileServerConnection(HNETLIBCONN hConnection, DWORD /*dwRemoteIP*/, void* extra)
+void JabberFileServerConnection(HNETLIBCONN hConnection, uint32_t /*dwRemoteIP*/, void* extra)
{
CJabberProto *ppro = (CJabberProto*)extra;
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp index 94277cede3..b6a5fe55c7 100644 --- a/protocols/JabberG/src/jabber_form.cpp +++ b/protocols/JabberG/src/jabber_form.cpp @@ -358,7 +358,7 @@ static void JabberFormAddListItem(TJabberFormControlInfo *item, const char *text {
Utf2T wszText(text);
- DWORD dwIndex;
+ uint32_t dwIndex;
switch (item->type) {
case JFORM_CTYPE_LIST_MULTI:
dwIndex = SendMessage(item->hCtrl, LB_ADDSTRING, 0, wszText);
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp index daf69dac02..1eb828b754 100644 --- a/protocols/JabberG/src/jabber_ft.cpp +++ b/protocols/JabberG/src/jabber_ft.cpp @@ -353,7 +353,7 @@ bool CJabberProto::FtIbbSend(int blocksize, filetransfer *ft) return false;
}
- ft->jibb->dwTransferredSize += (DWORD)numRead;
+ ft->jibb->dwTransferredSize += (uint32_t)numRead;
ft->std.currentFileProgress += numRead;
ft->std.totalProgress += numRead;
ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
@@ -781,7 +781,7 @@ bool CJabberProto::FtTryInlineFile(filetransfer *ft) CMStringW wszFileName(FORMAT, L"%s\\%S%s", wszTempPath.get(), szHash, ProtoGetAvatarExtension(fileFormat));
if (_waccess(wszFileName, 0))
if (!CopyFileW(ft->std.szCurrentFile.w, wszFileName, FALSE)) {
- DWORD dwError = GetLastError();
+ uint32_t dwError = GetLastError();
debugLogW(L"File <%s> cannot be copied to <%s>: error %d", ft->std.szCurrentFile.w, wszFileName.c_str(), dwError);
return false;
}
diff --git a/protocols/JabberG/src/jabber_ibb.cpp b/protocols/JabberG/src/jabber_ibb.cpp index 3fefc2f186..8aa42dd62c 100644 --- a/protocols/JabberG/src/jabber_ibb.cpp +++ b/protocols/JabberG/src/jabber_ibb.cpp @@ -186,6 +186,6 @@ bool CJabberProto::OnIbbRecvdData(const char *data, const char *sid, const char return false;
(this->*item->jibb->pfnRecv)(nullptr, item->ft, decodedData, (int)length);
- item->jibb->dwTransferredSize += (DWORD)length;
+ item->jibb->dwTransferredSize += (uint32_t)length;
return true;
}
diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp index 77c71e282c..aa31b3767c 100644 --- a/protocols/JabberG/src/jabber_iq.cpp +++ b/protocols/JabberG/src/jabber_iq.cpp @@ -325,7 +325,7 @@ CJabberIqInfo* CJabberIqManager::DetachInfo(void *pUserData) CJabberIqInfo* CJabberIqManager::DetachExpired()
{
- DWORD dwCurrentTime = GetTickCount();
+ uint32_t dwCurrentTime = GetTickCount();
mir_cslock lck(m_cs);
@@ -341,7 +341,7 @@ CJabberIqInfo* CJabberIqManager::DetachExpired() CJabberIqPermanentInfo* CJabberIqManager::AddPermanentHandler(
JABBER_PERMANENT_IQ_HANDLER pHandler,
int nIqTypes,
- DWORD dwParamsToParse,
+ uint32_t dwParamsToParse,
const char *szXmlns,
BOOL bAllowPartialNs,
const char *szTag,
diff --git a/protocols/JabberG/src/jabber_iq.h b/protocols/JabberG/src/jabber_iq.h index fcc4a042da..b352a81d81 100644 --- a/protocols/JabberG/src/jabber_iq.h +++ b/protocols/JabberG/src/jabber_iq.h @@ -56,9 +56,9 @@ protected: JABBER_IQ_HANDLER m_pHandler;
int m_nIqId;
- DWORD m_dwParamsToParse;
- DWORD m_dwRequestTime;
- DWORD m_dwTimeout;
+ uint32_t m_dwParamsToParse;
+ uint32_t m_dwRequestTime;
+ uint32_t m_dwTimeout;
char* m_szReceiver;
int m_iPriority;
void* m_pUserData;
@@ -80,11 +80,11 @@ public: }
__forceinline void SetReceiver(const char *szReceiver) { replaceStr(m_szReceiver, szReceiver); }
- __forceinline void SetParamsToParse(DWORD dwParamsToParse) { m_dwParamsToParse = dwParamsToParse; }
- __forceinline void SetTimeout(DWORD dwTimeout) { m_dwTimeout = dwTimeout; }
+ __forceinline void SetParamsToParse(uint32_t dwParamsToParse) { m_dwParamsToParse = dwParamsToParse; }
+ __forceinline void SetTimeout(uint32_t dwTimeout) { m_dwTimeout = dwTimeout; }
__forceinline int GetIqId() const { return m_nIqId; }
- __forceinline DWORD GetRequestTime() const { return m_dwRequestTime; }
+ __forceinline uint32_t GetRequestTime() const { return m_dwRequestTime; }
__forceinline int GetIqType() const { return m_nIqType; }
__forceinline void* GetUserData() const { return m_pUserData; }
__forceinline const char* GetFrom() const { return m_szFrom; }
@@ -114,7 +114,7 @@ class CJabberIqPermanentInfo : public MZeroedObject friend class CJabberIqManager;
JABBER_PERMANENT_IQ_HANDLER m_pHandler;
- DWORD m_dwParamsToParse;
+ uint32_t m_dwParamsToParse;
int m_nIqTypes;
char *m_szXmlns;
char *m_szTag;
@@ -141,7 +141,7 @@ protected: CJabberProto *ppro;
mir_cs m_cs;
- DWORD m_dwLastUsedHandle = 0;
+ uint32_t m_dwLastUsedHandle = 0;
LIST<CJabberIqInfo> m_arIqs;
OBJLIST<CJabberIqPermanentInfo> m_arHandlers;
@@ -159,7 +159,7 @@ public: // fucking params, maybe just return CJabberIqRequestInfo pointer ?
CJabberIqInfo* AddHandler(JABBER_IQ_HANDLER pHandler, int nIqType, const char *szReceiver, void *pUserData, int iPriority);
- CJabberIqPermanentInfo* AddPermanentHandler(JABBER_PERMANENT_IQ_HANDLER pHandler, int nIqTypes, DWORD dwParamsToParse, const char *szXmlns, BOOL bAllowPartialNs, const char *szTag, void *pUserData = nullptr, IQ_USER_DATA_FREE_FUNC pUserDataFree = nullptr, int iPriority = JH_PRIORITY_DEFAULT);
+ CJabberIqPermanentInfo* AddPermanentHandler(JABBER_PERMANENT_IQ_HANDLER pHandler, int nIqTypes, uint32_t dwParamsToParse, const char *szXmlns, BOOL bAllowPartialNs, const char *szTag, void *pUserData = nullptr, IQ_USER_DATA_FREE_FUNC pUserDataFree = nullptr, int iPriority = JH_PRIORITY_DEFAULT);
// returns TRUE when pInfo found, or FALSE otherwise
bool DeletePermanentHandler(CJabberIqPermanentInfo *pInfo);
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index cef7f3a195..4bd9860af3 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -74,7 +74,7 @@ int GetGMTOffset(void) TIME_ZONE_INFORMATION tzinfo;
int nOffset = 0;
- DWORD dwResult = GetTimeZoneInformation(&tzinfo);
+ uint32_t dwResult = GetTimeZoneInformation(&tzinfo);
switch (dwResult) {
case TIME_ZONE_ID_STANDARD:
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 07931a08ad..553b659a5e 100755 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -124,14 +124,14 @@ void CJabberProto::OnIqResultNotes(const TiXmlElement *iqNode, CJabberIqInfo *pI m_notes.LoadXml(storage);
}
-void CJabberProto::OnProcessLoginRq(ThreadData *info, DWORD rq)
+void CJabberProto::OnProcessLoginRq(ThreadData *info, uint32_t rq)
{
if (info == nullptr)
return;
info->dwLoginRqs |= rq;
- DWORD dwMask = JABBER_LOGIN_ROSTER | JABBER_LOGIN_BOOKMARKS | JABBER_LOGIN_SERVERINFO;
+ uint32_t dwMask = JABBER_LOGIN_ROSTER | JABBER_LOGIN_BOOKMARKS | JABBER_LOGIN_SERVERINFO;
if ((info->dwLoginRqs & dwMask) == dwMask && !(info->dwLoginRqs & JABBER_LOGIN_BOOKMARKS_AJ)) {
if (info->jabberServerCaps & JABBER_CAPS_ARCHIVE_AUTO)
EnableArchive(m_bEnableMsgArchive != 0);
@@ -531,7 +531,7 @@ void CJabberProto::OnIqResultGetVcardPhoto(const TiXmlElement *n, MCONTACT hCont debugLogA("Writing %d bytes", bufferLen);
DWORD nWritten;
- bool bRes = WriteFile(hFile, buffer, (DWORD)bufferLen, &nWritten, nullptr) != 0;
+ bool bRes = WriteFile(hFile, buffer, (uint32_t)bufferLen, &nWritten, nullptr) != 0;
CloseHandle(hFile);
if (!bRes)
return;
diff --git a/protocols/JabberG/src/jabber_list.h b/protocols/JabberG/src/jabber_list.h index 05d65fdb23..dca8f305a4 100644 --- a/protocols/JabberG/src/jabber_list.h +++ b/protocols/JabberG/src/jabber_list.h @@ -104,7 +104,7 @@ public: // XEP-0115 support
CJabberClientPartialCaps *m_pCaps;
ptrA m_tszCapsExt;
- DWORD m_dwDiscoInfoRequestTime;
+ uint32_t m_dwDiscoInfoRequestTime;
JabberCapsBits m_jcbCachedCaps;
JabberCapsBits m_jcbManualDiscoveredCaps;
@@ -185,7 +185,7 @@ struct JABBER_LIST_ITEM : public MZeroedObject HWND hwndGcListAdmin;
HWND hwndGcListOwner;
int iChatState;
- DWORD dwChatInitTime;
+ uint32_t dwChatInitTime;
// LIST_FILE
// jid = string representation of port number
diff --git a/protocols/JabberG/src/jabber_message_manager.cpp b/protocols/JabberG/src/jabber_message_manager.cpp index 40f14c5d5a..0eed38b981 100644 --- a/protocols/JabberG/src/jabber_message_manager.cpp +++ b/protocols/JabberG/src/jabber_message_manager.cpp @@ -110,7 +110,7 @@ bool CJabberMessageManager::HandleMessagePermanent(const TiXmlElement *node, Thr CJabberMessagePermanentInfo* CJabberMessageManager::AddPermanentHandler(
JABBER_PERMANENT_MESSAGE_HANDLER pHandler,
int nMessageTypes,
- DWORD dwParamsToParse,
+ uint32_t dwParamsToParse,
const char *szXmlns,
BOOL bAllowPartialNs,
const char *szTag,
diff --git a/protocols/JabberG/src/jabber_message_manager.h b/protocols/JabberG/src/jabber_message_manager.h index ebea3fab85..71e0ed1d9a 100644 --- a/protocols/JabberG/src/jabber_message_manager.h +++ b/protocols/JabberG/src/jabber_message_manager.h @@ -93,7 +93,7 @@ class CJabberMessagePermanentInfo : public MZeroedObject friend class CJabberMessageManager;
JABBER_PERMANENT_MESSAGE_HANDLER m_pHandler;
- DWORD m_dwParamsToParse;
+ uint32_t m_dwParamsToParse;
int m_nMessageTypes;
char *m_szXmlns;
char *m_szTag;
@@ -125,7 +125,7 @@ public: CJabberMessageManager(CJabberProto *proto);
~CJabberMessageManager();
- CJabberMessagePermanentInfo* AddPermanentHandler(JABBER_PERMANENT_MESSAGE_HANDLER pHandler, int nMessageTypes, DWORD dwParamsToParse, const char *szXmlns, BOOL bAllowPartialNs, const char *szTag, void *pUserData = nullptr, MESSAGE_USER_DATA_FREE_FUNC pUserDataFree = nullptr, int iPriority = JH_PRIORITY_DEFAULT);
+ CJabberMessagePermanentInfo* AddPermanentHandler(JABBER_PERMANENT_MESSAGE_HANDLER pHandler, int nMessageTypes, uint32_t dwParamsToParse, const char *szXmlns, BOOL bAllowPartialNs, const char *szTag, void *pUserData = nullptr, MESSAGE_USER_DATA_FREE_FUNC pUserDataFree = nullptr, int iPriority = JH_PRIORITY_DEFAULT);
bool DeletePermanentHandler(CJabberMessagePermanentInfo *pInfo);
bool HandleMessagePermanent(const TiXmlElement *node, ThreadData *pThreadData);
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 692510e09b..a5a42d922f 100755 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -53,7 +53,7 @@ void CJabberProto::DBAddAuthRequest(const char *jid, const char *nick) DB::AUTH_BLOB blob(hContact, nick, nullptr, nullptr, jid, nullptr);
PROTORECVEVENT pre = {};
- pre.timestamp = (DWORD)time(0);
+ pre.timestamp = (uint32_t)time(0);
pre.lParam = blob.size();
pre.szMessage = blob;
ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&pre);
@@ -468,7 +468,7 @@ static bool SaveBlobToFile(const wchar_t *pwszFileName, const CMStringA &body) DWORD n;
size_t bufferLen;
ptrA buffer((char *)mir_base64_decode(body, &bufferLen));
- WriteFile(h, buffer, (DWORD)bufferLen, &n, nullptr);
+ WriteFile(h, buffer, (uint32_t)bufferLen, &n, nullptr);
CloseHandle(h);
return true;
}
diff --git a/protocols/JabberG/src/jabber_omemo.cpp b/protocols/JabberG/src/jabber_omemo.cpp index 8248deddce..fe66654589 100755 --- a/protocols/JabberG/src/jabber_omemo.cpp +++ b/protocols/JabberG/src/jabber_omemo.cpp @@ -1184,7 +1184,7 @@ complete: bool omemo_impl::create_session_store(MCONTACT hContact, const char *device_id)
{
signal_store_backend_user_data *data[4];
- DWORD device_id_int = strtoul(device_id, nullptr, 10);
+ uint32_t device_id_int = strtoul(device_id, nullptr, 10);
for (int i = 0; i < 4; i++) {
data[i] = (signal_store_backend_user_data*)mir_alloc(sizeof(signal_store_backend_user_data));
data[i]->hContact = hContact;
@@ -1243,7 +1243,7 @@ complete: const char *signed_pre_key_public, const char *signed_pre_key_signature, const char *identity_key)
{
// Instantiate a session_builder for a recipient address.
- DWORD dev_id_int = strtoul(dev_id, nullptr, 10);
+ uint32_t dev_id_int = strtoul(dev_id, nullptr, 10);
auto &pSession = sessions[hContact][dev_id_int];
// libsignal does not copy structure, so we must allocate one manually, does it free it on exit ?
@@ -1438,7 +1438,7 @@ void CJabberProto::OmemoHandleMessageQueue() }
}
-DWORD JabberGetLastContactMessageTime(MCONTACT hContact);
+uint32_t JabberGetLastContactMessageTime(MCONTACT hContact);
bool CJabberProto::OmemoHandleMessage(const TiXmlElement *node, const char *jid, time_t msgTime)
{
@@ -1472,7 +1472,7 @@ bool CJabberProto::OmemoHandleMessage(const TiXmlElement *node, const char *jid, debugLogA("Jabber OMEMO: error: failed to get sender device id");
return true;
}
- DWORD sender_dev_id_int = strtoul(sender_dev_id, nullptr, 10);
+ uint32_t sender_dev_id_int = strtoul(sender_dev_id, nullptr, 10);
auto &pSession = m_omemo.sessions[hContact][sender_dev_id_int];
if (!pSession.cipher || !pSession.builder || !pSession.store_context) {
@@ -1481,10 +1481,10 @@ bool CJabberProto::OmemoHandleMessage(const TiXmlElement *node, const char *jid, return false;
}
- DWORD own_id = m_omemo.GetOwnDeviceId();
+ uint32_t own_id = m_omemo.GetOwnDeviceId();
const char *encrypted_key_base64 = nullptr;
for (auto *it : TiXmlFilter(header_node, "key")) {
- DWORD dev_id_int = it->IntAttribute("rid");
+ uint32_t dev_id_int = it->IntAttribute("rid");
if (dev_id_int == own_id) {
encrypted_key_base64 = it->GetText();
break;
@@ -1674,7 +1674,7 @@ bool CJabberProto::OmemoHandleMessage(const TiXmlElement *node, const char *jid, msgTime = now;
PROTORECVEVENT recv = {};
- recv.timestamp = (DWORD)msgTime;
+ recv.timestamp = (uint32_t)msgTime;
recv.szMessage = mir_strdup(out);
ProtoChainRecvMsg(hContact, &recv);
mir_free(out);
@@ -1715,7 +1715,7 @@ void CJabberProto::OmemoHandleDeviceList(const char *from, const TiXmlElement *n setDword(setting_name, current_id);
}
- DWORD val = 0;
+ uint32_t val = 0;
mir_snprintf(setting_name, "OmemoDeviceId%d", i);
val = getDword(setting_name, 0);
while (val) {
@@ -1738,7 +1738,7 @@ void CJabberProto::OmemoHandleDeviceList(const char *from, const TiXmlElement *n }
mir_snprintf(setting_name, "OmemoDeviceId%d", i);
- DWORD val = getDword(hContact, setting_name, 0);
+ uint32_t val = getDword(hContact, setting_name, 0);
while (val) {
delSetting(hContact, setting_name);
i++;
@@ -1756,7 +1756,7 @@ void CJabberProto::OmemoAnnounceDevice() char setting_name[64];
for (int i = 0;; ++i) {
mir_snprintf(setting_name, "OmemoDeviceId%d", i);
- DWORD val = getDword(setting_name);
+ uint32_t val = getDword(setting_name);
if (val == 0)
break;
if (val == own_id)
@@ -1775,7 +1775,7 @@ void CJabberProto::OmemoAnnounceDevice() for (int i = 0; ; ++i) {
mir_snprintf(setting_name, "OmemoDeviceId%d", i);
- DWORD val = getDword(setting_name);
+ uint32_t val = getDword(setting_name);
if (val == 0)
break;
@@ -1805,7 +1805,7 @@ int db_enum_settings_prekeys_cb(const char *szSetting, void *lParam) void CJabberProto::OmemoSendBundle()
{
// get own device id
- DWORD own_id = m_omemo.GetOwnDeviceId();
+ uint32_t own_id = m_omemo.GetOwnDeviceId();
// construct bundle node
char szBareJid[JABBER_MAX_JID_LEN];
@@ -1941,7 +1941,7 @@ void CJabberProto::OmemoOnIqResultGetBundle(const TiXmlElement *iqNode, CJabberI // failed to get bundle, do not try to build session
unsigned int *dev_id = (unsigned int*)pInfo->GetUserData();
char setting_name[64], setting_name2[64];
- DWORD id = 0;
+ uint32_t id = 0;
int i = 0;
mir_snprintf(setting_name, "OmemoDeviceId%d", i);
@@ -2036,7 +2036,7 @@ void CJabberProto::OmemoOnIqResultGetBundle(const TiXmlElement *iqNode, CJabberI unsigned int *dev_id = (unsigned int*)pInfo->GetUserData();
char setting_name[64], setting_name2[64];
- DWORD id = 0;
+ uint32_t id = 0;
int i = 0;
mir_snprintf(setting_name, "OmemoDeviceId%d", i);
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 97a821e275..7943726c07 100755 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "jabber_list.h"
#include "jabber_caps.h"
-static BOOL(WINAPI *pfnEnableThemeDialogTexture)(HANDLE, DWORD) = nullptr;
+static BOOL(WINAPI *pfnEnableThemeDialogTexture)(HANDLE, uint32_t) = nullptr;
/////////////////////////////////////////////////////////////////////////////////////////
// JabberRegisterDlgProc - the dialog proc for registering new account
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 6559ac437e..a4ebdd1aa9 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -118,11 +118,11 @@ void CJabberProto::OnIqResultPrivacyList(const TiXmlElement *iqNode, CJabberIqIn bAllow = false;
const char *itemOrder = XmlGetAttr(item, "order");
- DWORD dwOrder = 0;
+ uint32_t dwOrder = 0;
if (itemOrder)
dwOrder = atoi(itemOrder);
- DWORD dwPackets = 0;
+ uint32_t dwPackets = 0;
if (XmlFirstChild(item, "message"))
dwPackets |= JABBER_PL_RULE_TYPE_MESSAGE;
if (XmlFirstChild(item, "presence-in"))
@@ -345,7 +345,7 @@ public: m_cbAction.AddString(TranslateT("Allow"));
m_cbAction.SetCurSel(m_pRule->GetAction() ? 1 : 0);
- DWORD dwPackets = m_pRule->GetPackets();
+ uint32_t dwPackets = m_pRule->GetPackets();
if (!dwPackets)
dwPackets = JABBER_PL_RULE_TYPE_ALL;
if (dwPackets & JABBER_PL_RULE_TYPE_IQ)
@@ -390,7 +390,7 @@ public: m_pRule->SetType((PrivacyListRuleType)nItemData);
m_pRule->SetAction(m_cbAction.GetCurSel());
- DWORD dwPackets = 0;
+ uint32_t dwPackets = 0;
if (BST_CHECKED == IsDlgButtonChecked(m_hwnd, IDC_CHECK_MESSAGES))
dwPackets |= JABBER_PL_RULE_TYPE_MESSAGE;
if (BST_CHECKED == IsDlgButtonChecked(m_hwnd, IDC_CHECK_PRESENCE_IN))
@@ -592,7 +592,7 @@ class CJabberDlgPrivacyLists : public CJabberDlgBase CMStringA szPackets;
- DWORD dwPackets = pRule->GetPackets();
+ uint32_t dwPackets = pRule->GetPackets();
if (!dwPackets)
dwPackets = JABBER_PL_RULE_TYPE_ALL;
if (dwPackets == JABBER_PL_RULE_TYPE_ALL)
@@ -895,7 +895,7 @@ class CJabberDlgPrivacyLists : public CJabberDlgBase m_clcClist.SetExtraImage(hItem, i, hide ? EMPTY_EXTRA_ICON : 0);
}
- void CListSetupIcons(HANDLE hItem, int iSlot, DWORD dwProcess, BOOL bAction)
+ void CListSetupIcons(HANDLE hItem, int iSlot, uint32_t dwProcess, BOOL bAction)
{
if (dwProcess && !m_clcClist.GetExtraImage(hItem, iSlot))
m_clcClist.SetExtraImage(hItem, iSlot, iSlot * 2 + (bAction ? 1 : 2));
@@ -977,7 +977,7 @@ class CJabberDlgPrivacyLists : public CJabberDlgBase if (!hItem)
continue;
- DWORD dwPackets = pRule->GetPackets();
+ uint32_t dwPackets = pRule->GetPackets();
if (!dwPackets) dwPackets = JABBER_PL_RULE_TYPE_ALL;
CListSetupIcons(hItem, 0, dwPackets & JABBER_PL_RULE_TYPE_MESSAGE, pRule->GetAction());
CListSetupIcons(hItem, 1, dwPackets & JABBER_PL_RULE_TYPE_PRESENCE_IN, pRule->GetAction());
@@ -989,9 +989,9 @@ lbl_return: clc_info.bChanged = false;
}
- DWORD CListGetPackets(HANDLE hItem, bool bAction)
+ uint32_t CListGetPackets(HANDLE hItem, bool bAction)
{
- DWORD result = 0;
+ uint32_t result = 0;
int iIcon = m_clcClist.GetExtraImage(hItem, 0);
if (bAction && (iIcon == 1)) result |= JABBER_PL_RULE_TYPE_MESSAGE;
@@ -1019,8 +1019,8 @@ lbl_return: clc_info.bChanged = false;
- DWORD dwOrder = 0;
- DWORD dwPackets = 0;
+ uint32_t dwOrder = 0;
+ uint32_t dwPackets = 0;
pList->RemoveAllRules();
@@ -1844,7 +1844,7 @@ public: else
itemTag << XATTR("action", "deny");
itemTag << XATTRI("order", pRule->GetOrder());
- DWORD dwPackets = pRule->GetPackets();
+ uint32_t dwPackets = pRule->GetPackets();
if (dwPackets != JABBER_PL_RULE_TYPE_ALL) {
if (dwPackets & JABBER_PL_RULE_TYPE_IQ)
itemTag << XCHILD("iq");
@@ -1892,7 +1892,7 @@ public: if (evt->info->iColumn == -1)
return;
- DWORD hitFlags;
+ uint32_t hitFlags;
HANDLE hItem = m_clcClist.HitTest(evt->info->pt.x, evt->info->pt.y, &hitFlags);
if (hItem == nullptr || !(hitFlags & CLCHT_ONITEMEXTRA))
return;
diff --git a/protocols/JabberG/src/jabber_privacy.h b/protocols/JabberG/src/jabber_privacy.h index d2037b2a0b..df65014a88 100644 --- a/protocols/JabberG/src/jabber_privacy.h +++ b/protocols/JabberG/src/jabber_privacy.h @@ -59,7 +59,7 @@ protected: friend class CPrivacyList;
public:
- CPrivacyListRule(CJabberProto *ppro, PrivacyListRuleType type = Else, const char *szValue = "", bool bAction = true, DWORD dwOrder = 90, DWORD dwPackets = 0)
+ CPrivacyListRule(CJabberProto *ppro, PrivacyListRuleType type = Else, const char *szValue = "", bool bAction = true, uint32_t dwOrder = 90, uint32_t dwPackets = 0)
{
m_proto = ppro;
m_szValue = mir_strdup(szValue);
@@ -85,13 +85,13 @@ public: m_pNext = pNext;
return pRetVal;
}
- __inline DWORD GetOrder()
+ __inline uint32_t GetOrder()
{
return m_dwOrder;
}
- DWORD SetOrder(DWORD dwOrder)
+ uint32_t SetOrder(uint32_t dwOrder)
{
- DWORD dwRetVal = m_dwOrder;
+ uint32_t dwRetVal = m_dwOrder;
m_dwOrder = dwOrder;
return dwRetVal;
}
@@ -111,11 +111,11 @@ public: {
replaceStr(m_szValue, szValue);
}
- __inline DWORD GetPackets()
+ __inline uint32_t GetPackets()
{
return m_dwPackets;
}
- __inline void SetPackets(DWORD dwPackets)
+ __inline void SetPackets(uint32_t dwPackets)
{
m_dwPackets = dwPackets;
}
@@ -134,8 +134,8 @@ protected: PrivacyListRuleType m_nType;
char *m_szValue;
bool m_bAction;
- DWORD m_dwOrder;
- DWORD m_dwPackets;
+ uint32_t m_dwOrder;
+ uint32_t m_dwPackets;
CPrivacyListRule *m_pNext;
};
@@ -194,7 +194,7 @@ public: return pRetVal;
}
- void AddRule(PrivacyListRuleType type, const char *szValue, BOOL bAction, DWORD dwOrder, DWORD dwPackets)
+ void AddRule(PrivacyListRuleType type, const char *szValue, BOOL bAction, uint32_t dwOrder, uint32_t dwPackets)
{
CPrivacyListRule *pRule = new CPrivacyListRule(m_proto, type, szValue, bAction, dwOrder, dwPackets);
pRule->SetNext(m_pRules);
@@ -243,7 +243,7 @@ public: }
// get rules count
- DWORD dwCount = 0;
+ uint32_t dwCount = 0;
CPrivacyListRule *pRule = m_pRules;
while (pRule) {
dwCount++;
@@ -254,7 +254,7 @@ public: CPrivacyListRule **pRules = (CPrivacyListRule **)mir_alloc(dwCount * sizeof(CPrivacyListRule *));
if (!pRules)
return false;
- DWORD dwPos = 0;
+ uint32_t dwPos = 0;
pRule = m_pRules;
while (pRule) {
pRules[dwPos++] = pRule;
@@ -262,7 +262,7 @@ public: }
// sort array of pointers, slow, but working :)
- DWORD i, j;
+ uint32_t i, j;
CPrivacyListRule *pTmp;
for (i=0; i < dwCount; i++) {
for (j = dwCount - 1; j > i; j--) {
@@ -275,7 +275,7 @@ public: }
// reorder linked list
- DWORD dwOrder = 100;
+ uint32_t dwOrder = 100;
CPrivacyListRule **ppPtr = &m_pRules;
for (i=0; i < dwCount; i++) {
*ppPtr = pRules[ i ];
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 9ff764ecdc..411a64998d 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -357,7 +357,7 @@ void CJabberProto::OnShutdown() ////////////////////////////////////////////////////////////////////////////////////////
// JabberAddToList - adds a contact to the contact list
-MCONTACT CJabberProto::AddToListByJID(const char *newJid, DWORD flags)
+MCONTACT CJabberProto::AddToListByJID(const char *newJid, uint32_t flags)
{
debugLogA("AddToListByJID jid = %s", newJid);
@@ -452,7 +452,7 @@ int CJabberProto::AuthDeny(MEVENT hDbEvent, const wchar_t*) if (mir_strcmp(dbei.szModule, m_szModuleName))
return 1;
- char *nick = (char*)(dbei.pBlob + sizeof(DWORD) * 2);
+ char *nick = (char*)(dbei.pBlob + sizeof(uint32_t) * 2);
char *firstName = nick + mir_strlen(nick) + 1;
char *lastName = firstName + mir_strlen(firstName) + 1;
char *jid = lastName + mir_strlen(lastName) + 1;
@@ -577,7 +577,7 @@ int CJabberProto::FileResume(HANDLE hTransfer, int, const wchar_t *szFilename) INT_PTR CJabberProto::GetCaps(int type, MCONTACT hContact)
{
- DWORD dwFlags;
+ uint32_t dwFlags;
switch (type) {
case PFLAGNUM_1:
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index b82abb54e4..71a6c498b8 100755 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -236,8 +236,8 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface CMOption<bool> m_bUseTLS;
CMOption<int> m_iMamMode;
- CMOption<DWORD> m_iConnectionKeepAliveInterval;
- CMOption<DWORD> m_iConnectionKeepAliveTimeout;
+ CMOption<uint32_t> m_iConnectionKeepAliveInterval;
+ CMOption<uint32_t> m_iConnectionKeepAliveTimeout;
PVOID m_sslCtx;
@@ -324,8 +324,8 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface strm_mgmt m_StrmMgmt;
int m_nSDBrowseMode;
- DWORD m_dwSDLastRefresh;
- DWORD m_dwSDLastAutoDisco;
+ uint32_t m_dwSDLastRefresh;
+ uint32_t m_dwSDLastAutoDisco;
HGENMENU m_hChooseMenuItem;
int m_privacyMenuServiceAllocated;
@@ -454,8 +454,8 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void ConsoleUninit(void);
- bool FilterXml(const TiXmlElement *node, DWORD flags);
- bool RecursiveCheckFilter(const TiXmlElement *node, DWORD flags);
+ bool FilterXml(const TiXmlElement *node, uint32_t flags);
+ bool RecursiveCheckFilter(const TiXmlElement *node, uint32_t flags);
//---- jabber_disco.cpp --------------------------------------------------------------
@@ -566,7 +566,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void OnIqResultSetPassword(const TiXmlElement *iqNode, CJabberIqInfo *pInfo);
void OnIqResultSetSearch(const TiXmlElement *iqNode, CJabberIqInfo *pInfo);
void OnIqResultSetVcard(const TiXmlElement *iqNode, CJabberIqInfo *pInfo);
- void OnProcessLoginRq(ThreadData *info, DWORD rq);
+ void OnProcessLoginRq(ThreadData *info, uint32_t rq);
void OnLoggedIn(void);
//---- jabber_iq_handlers.cpp -------------------------------------------------------
@@ -747,7 +747,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void __cdecl GetAwayMsgThread(void* hContact);
void __cdecl SendMessageAckThread(void* hContact);
- MCONTACT AddToListByJID(const char *newJid, DWORD flags);
+ MCONTACT AddToListByJID(const char *newJid, uint32_t flags);
void InfoFrame_OnSetup(CJabberInfoFrame_Event *evt);
void InfoFrame_OnTransport(CJabberInfoFrame_Event *evt);
@@ -892,7 +892,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface //---- jabber_xml.c ------------------------------------------------------------------
- void OnConsoleProcessXml(const TiXmlElement *node, DWORD flags);
+ void OnConsoleProcessXml(const TiXmlElement *node, uint32_t flags);
//---- jabber_xmlns.c ----------------------------------------------------------------
@@ -928,7 +928,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface private:
char *m_szXmlStreamToBeInitialized;
- DWORD m_lastTicks;
+ uint32_t m_lastTicks;
HANDLE m_hPopupClass;
@@ -944,9 +944,9 @@ private: JabberFeatCapPairDynamic* FindFeature(const char *szFeature);
public:
- DWORD STDMETHODCALLTYPE GetFlags() const override; // Set of JIF_* flags.
+ uint32_t STDMETHODCALLTYPE GetFlags() const override; // Set of JIF_* flags.
int STDMETHODCALLTYPE GetVersion() const override; // Returns version of IJabberInterface.
- DWORD STDMETHODCALLTYPE GetJabberVersion() const override; // Returns Jabber plugin version.
+ uint32_t STDMETHODCALLTYPE GetJabberVersion() const override; // Returns Jabber plugin version.
MCONTACT STDMETHODCALLTYPE ContactFromJID(const char *jid) override; // Returns contact handle for given JID.
char* STDMETHODCALLTYPE ContactToJID(MCONTACT hContact) override; // Returns JID of hContact. You must free the result using mir_free().
diff --git a/protocols/JabberG/src/jabber_rc.h b/protocols/JabberG/src/jabber_rc.h index d3eb91a051..2563e8998f 100644 --- a/protocols/JabberG/src/jabber_rc.h +++ b/protocols/JabberG/src/jabber_rc.h @@ -44,12 +44,12 @@ class CJabberAdhocSession protected:
CMStringA m_szSessionId;
CJabberAdhocSession* m_pNext = nullptr;
- DWORD m_dwStartTime;
+ uint32_t m_dwStartTime;
void* m_pUserData = nullptr;
BOOL m_bAutofreeUserData;
- DWORD m_dwStage = 0;
+ uint32_t m_dwStage = 0;
public:
CJabberProto *ppro;
@@ -74,7 +74,7 @@ public: return pRetVal;
}
- DWORD GetSessionStartTime()
+ uint32_t GetSessionStartTime()
{
return m_dwStartTime;
}
@@ -92,14 +92,14 @@ public: m_bAutofreeUserData = bAutofree;
}
- DWORD SetStage(DWORD dwStage)
+ uint32_t SetStage(uint32_t dwStage)
{
- DWORD dwRetVal = m_dwStage;
+ uint32_t dwRetVal = m_dwStage;
m_dwStage = dwStage;
return dwRetVal;
}
- DWORD GetStage()
+ uint32_t GetStage()
{
return m_dwStage;
}
@@ -232,7 +232,7 @@ protected: return false;
}
- bool _ExpireSession(DWORD dwExpireTime)
+ bool _ExpireSession(uint32_t dwExpireTime)
{
if (!m_pSessions)
return false;
@@ -299,7 +299,7 @@ public: void ExpireSessions()
{
mir_cslock lck(m_cs);
- DWORD dwExpireTime = GetTickCount() - JABBER_ADHOC_SESSION_EXPIRE_TIME;
+ uint32_t dwExpireTime = GetTickCount() - JABBER_ADHOC_SESSION_EXPIRE_TIME;
while (_ExpireSession(dwExpireTime))
;
}
diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp index e04321e669..8522b396d7 100644 --- a/protocols/JabberG/src/jabber_secur.cpp +++ b/protocols/JabberG/src/jabber_secur.cpp @@ -149,7 +149,7 @@ char* TMD5Auth::getChallenge(const char *challenge) const char *realm = pairs["realm"], *nonce = pairs["nonce"];
char cnonce[40], tmpBuf[40];
- DWORD digest[4], hash1[4], hash2[4];
+ uint32_t digest[4], hash1[4], hash2[4];
mir_md5_state_t ctx;
Utils_GetRandom(digest, sizeof(digest));
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 38cb49427c..9735b9eb07 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -971,7 +971,7 @@ void CJabberProto::OnProcessPubsubEvent(const TiXmlElement *node) }
// returns 0, if error or no events
-DWORD JabberGetLastContactMessageTime(MCONTACT hContact)
+uint32_t JabberGetLastContactMessageTime(MCONTACT hContact)
{
// TODO: time cache can improve performance
MEVENT hDbEvent = db_event_last(hContact);
@@ -1404,7 +1404,7 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info) if (bWasSent)
recv.flags |= PREF_SENT;
- recv.timestamp = (DWORD)msgTime;
+ recv.timestamp = (uint32_t)msgTime;
recv.szMessage = szMessage.GetBuffer();
recv.szMsgId = szMsgId;
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 4ab95a77e6..a414fbed87 100755 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -69,7 +69,7 @@ enum INFOLINE_LASTACTIVE, }; -__forceinline DWORD sttInfoLineId(DWORD res, DWORD type, DWORD line = 0) +__forceinline uint32_t sttInfoLineId(uint32_t res, uint32_t type, uint32_t line = 0) { return (type << 24) & 0x7f000000 | @@ -274,7 +274,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti } } -static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM htiRoot, DWORD dwInfoLine, MCONTACT hContact, wchar_t *szTitle, char *pszSlot) +static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM htiRoot, uint32_t dwInfoLine, MCONTACT hContact, wchar_t *szTitle, char *pszSlot) { char *szAdvStatusIcon = ppro->ReadAdvStatusA(hContact, pszSlot, ADVSTATUS_VAL_ICON); wchar_t *szAdvStatusTitle = ppro->ReadAdvStatusT(hContact, pszSlot, ADVSTATUS_VAL_TITLE); diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index b8ddd22545..008faa9aff 100755 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -799,8 +799,8 @@ const wchar_t *JabberStrIStr(const wchar_t *str, const wchar_t *substr) wchar_t *str_up = NEWWSTR_ALLOCA(str);
wchar_t *substr_up = NEWWSTR_ALLOCA(substr);
- CharUpperBuff(str_up, (DWORD)mir_wstrlen(str_up));
- CharUpperBuff(substr_up, (DWORD)mir_wstrlen(substr_up));
+ CharUpperBuff(str_up, (uint32_t)mir_wstrlen(str_up));
+ CharUpperBuff(substr_up, (uint32_t)mir_wstrlen(substr_up));
wchar_t *p = wcsstr(str_up, substr_up);
return p ? (str + (p - str_up)) : nullptr;
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 41902de81d..d72ba542c9 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -1305,7 +1305,7 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusEx(WPARAM hContact, LPARAM lParam) // fill status name member
if (pData->flags & CSSF_MASK_NAME) {
if (pData->flags & CSSF_DEFAULT_NAME) {
- DWORD dwXStatus = (pData->wParam == nullptr) ? pepMood->m_mode : *pData->wParam;
+ uint32_t dwXStatus = (pData->wParam == nullptr) ? pepMood->m_mode : *pData->wParam;
if (dwXStatus >= _countof(g_arrMoods))
return 1;
@@ -1316,7 +1316,7 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusEx(WPARAM hContact, LPARAM lParam) if (dwStatusTitleSize > STATUS_TITLE_MAX)
dwStatusTitleSize = STATUS_TITLE_MAX;
- WideCharToMultiByte(CP_ACP, 0, g_arrMoods[dwXStatus].szName, (DWORD)dwStatusTitleSize, pData->pszName, MAX_PATH, nullptr, nullptr);
+ WideCharToMultiByte(CP_ACP, 0, g_arrMoods[dwXStatus].szName, (uint32_t)dwStatusTitleSize, pData->pszName, MAX_PATH, nullptr, nullptr);
pData->pszName[dwStatusTitleSize] = 0;
}
}
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index 2cc9550b8f..74e6751817 100755 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -367,7 +367,7 @@ struct ThreadData bool bIsReg;
bool reg_done, bIsSessionAvailable;
bool bBookmarksLoaded;
- DWORD dwLoginRqs;
+ uint32_t dwLoginRqs;
// connection & login data
JABBER_CONN_DATA conn;
diff --git a/protocols/LotusNotify/src/LotusNotify.cpp b/protocols/LotusNotify/src/LotusNotify.cpp index 28bf497693..2f7bb85054 100644 --- a/protocols/LotusNotify/src/LotusNotify.cpp +++ b/protocols/LotusNotify/src/LotusNotify.cpp @@ -42,7 +42,7 @@ wchar_t settingFilterSubject[MAX_SETTING_STR] = TEXT(""), settingFilterSender[MA COLORREF settingBgColor, settingFgColor; int settingInterval = 0, settingInterval1 = 0; -DWORD settingNewestID = 0; +uint32_t settingNewestID = 0; uint8_t settingSetColours = 0, settingShowError = 1, settingIniAnswer = -1, settingIniCheck = 0, settingOnceOnly = 0, settingNonClickedOnly = 0, settingNewest = 0, settingEvenNonClicked = 0, settingKeepConnection = 1; BOOL settingStatus[STATUS_COUNT]; @@ -93,8 +93,8 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC STATUS LNPUBLIC __stdcall EMCallBack (EMRECORD * pData) { VARARG_PTR pArgs; - DWORD maxPwdLen; - DWORD * retLength; + uint32_t maxPwdLen; + uint32_t * retLength; char * retPassword; char * fileName; char * ownerName; @@ -103,14 +103,14 @@ STATUS LNPUBLIC __stdcall EMCallBack (EMRECORD * pData) if (pData->Status != NOERROR) return (ERR_EM_CONTINUE); pArgs= pData->Ap; - maxPwdLen = VARARG_GET (pArgs, DWORD); - retLength = VARARG_GET (pArgs, DWORD *); + maxPwdLen = VARARG_GET (pArgs, uint32_t); + retLength = VARARG_GET (pArgs, uint32_t *); retPassword = VARARG_GET (pArgs, char *); fileName = VARARG_GET (pArgs, char *); ownerName = VARARG_GET (pArgs, char *); strncpy(retPassword, settingPassword, mir_strlen(settingPassword)); //set our password retPassword[mir_strlen(settingPassword)]='\0'; - *retLength = (DWORD)mir_strlen(retPassword);//and his length + *retLength = (uint32_t)mir_strlen(retPassword);//and his length return ERR_BSAFE_EXTERNAL_PASSWORD; } @@ -144,7 +144,7 @@ void ExtClear() //check if msg was clicked and exists on msgs list -struct HISTORIA* getEl(DWORD id) +struct HISTORIA* getEl(uint32_t id) { for(struct HISTORIA *cur = first; cur != nullptr; cur = cur->next) { @@ -156,7 +156,7 @@ struct HISTORIA* getEl(DWORD id) //creates new entry on list of msgs -void addNewId(DWORD id) +void addNewId(uint32_t id) { struct HISTORIA* nowy = (struct HISTORIA*)mir_alloc(sizeof(struct HISTORIA)) ; assert(nowy); @@ -169,7 +169,7 @@ void addNewId(DWORD id) //add popup handle. This queue is used to close popups with same msg -void addPopup(DWORD id,HWND hWnd) +void addPopup(uint32_t id,HWND hWnd) { struct POPUPSQUEUE* nowy = (struct POPUPSQUEUE*)mir_alloc(sizeof(struct POPUPSQUEUE)) ; struct HISTORIA *elem = getEl(id); @@ -444,7 +444,7 @@ BOOL checkNotesIniFile(BOOL bInfo) //popup plugin to show popup function -void showMsg(wchar_t* sender,wchar_t* text, DWORD id, char *strUID) +void showMsg(wchar_t* sender,wchar_t* text, uint32_t id, char *strUID) { POPUPATT * mpd = (POPUPATT*)malloc(sizeof(POPUPATT)); mpd->id = id; @@ -544,7 +544,7 @@ void checkthread(void*) char UserName[MAXUSERNAME + 1]; HANDLE hTable; - DWORD noteID = 0L; + uint32_t noteID = 0L; BOOL fFirst = TRUE; NOTEHANDLE note_handle; @@ -623,8 +623,8 @@ void checkthread(void*) uint16_t Att; BLOCKID bhAttachment; - DWORD cSize = 0; - DWORD attSize = 0; + uint32_t cSize = 0; + uint32_t attSize = 0; OID retNoteOID; TIMEDATE retModified; /* modified timedate */ uint16_t retNoteClass; /* note class */ @@ -993,11 +993,11 @@ static void LoadSettings() settingNonClickedOnly = g_plugin.getByte("LNNonClickedOnly", 1); settingShowError = g_plugin.getByte("LNShowError", 1); settingSetColours = g_plugin.getByte("LNSetColours", 0); - settingBgColor = (COLORREF)g_plugin.getDword("LNBgColor", (DWORD)0xFFFFFF); - settingFgColor = (COLORREF)g_plugin.getDword("LNFgColor", (DWORD)0x000000); + settingBgColor = (COLORREF)g_plugin.getDword("LNBgColor", (uint32_t)0xFFFFFF); + settingFgColor = (COLORREF)g_plugin.getDword("LNFgColor", (uint32_t)0x000000); settingNewest = g_plugin.getByte("LNNewest", 0); settingEvenNonClicked = g_plugin.getByte("LNEvenNonClicked", 0); - settingNewestID = (DWORD)g_plugin.getDword("LNNewestID", 0); + settingNewestID = (uint32_t)g_plugin.getDword("LNNewestID", 0); settingIniAnswer = g_plugin.getByte("LNIniAnswer", 0); settingIniCheck = g_plugin.getByte("LNIniCheck", 0); @@ -1026,8 +1026,8 @@ static void SaveSettings(HWND hwndDlg) g_plugin.setByte("LNNonClickedOnly", settingNonClickedOnly); g_plugin.setByte("LNShowError", settingShowError); g_plugin.setByte("LNSetColours", settingSetColours); - g_plugin.setDword("LNBgColor", (DWORD)settingBgColor); - g_plugin.setDword("LNFgColor", (DWORD)settingFgColor); + g_plugin.setDword("LNBgColor", (uint32_t)settingBgColor); + g_plugin.setDword("LNFgColor", (uint32_t)settingFgColor); g_plugin.setByte("LNNewest", settingNewest); g_plugin.setByte("LNEvenNonClicked", settingEvenNonClicked); g_plugin.setByte("LNIniCheck", settingIniCheck); diff --git a/protocols/LotusNotify/src/LotusNotify.h b/protocols/LotusNotify/src/LotusNotify.h index 90f455e34f..e9e85a45e2 100644 --- a/protocols/LotusNotify/src/LotusNotify.h +++ b/protocols/LotusNotify/src/LotusNotify.h @@ -2,7 +2,7 @@ struct HISTORIA { - DWORD noteID; + uint32_t noteID; BOOL clicked; BOOL again; struct HISTORIA *next; @@ -18,7 +18,7 @@ struct POPUPSQUEUE // structure contines only LN msg id to send to popup typedef struct { - DWORD id; + uint32_t id; char strNote[4*16]; } POPUPATT; diff --git a/protocols/LotusNotify/src/lotusnotes.cpp b/protocols/LotusNotify/src/lotusnotes.cpp index 4867d094bb..5ab49b6a4d 100644 --- a/protocols/LotusNotify/src/lotusnotes.cpp +++ b/protocols/LotusNotify/src/lotusnotes.cpp @@ -68,16 +68,12 @@ BOOL HookLotusFunctions() void GetLotusPath(wchar_t *sTemp, DWORD size) { - DWORD rc; HKEY dmKey; + DWORD rc = RegOpenKeyEx( HKEY_LOCAL_MACHINE , TEXT("Software\\Lotus\\Notes") ,0, KEY_QUERY_VALUE, &dmKey ); + if (rc != ERROR_SUCCESS) + return; - rc = RegOpenKeyEx( HKEY_LOCAL_MACHINE , TEXT("Software\\Lotus\\Notes") ,0, KEY_QUERY_VALUE, &dmKey ); - - if (rc != ERROR_SUCCESS) { - return; - } - - RegQueryValueEx( dmKey, TEXT("Path"), nullptr, nullptr, (uint8_t*)sTemp, &size ); + RegQueryValueEx( dmKey, TEXT("Path"), nullptr, nullptr, (uint8_t*)sTemp, &size); RegCloseKey(dmKey); return; } diff --git a/protocols/LotusNotify/src/lotusnotes.h b/protocols/LotusNotify/src/lotusnotes.h index ba8288a014..8a2a00c650 100644 --- a/protocols/LotusNotify/src/lotusnotes.h +++ b/protocols/LotusNotify/src/lotusnotes.h @@ -40,7 +40,7 @@ extern NSFDBUPDATEUNREAD NSFDbUpdateUnread1; typedef BOOL (CALLBACK LNPUBLIC *IDSCAN)( HANDLE hTable,///DHANDLE BOOL fFirst, - DWORD far *retID); + uint32_t far *retID); extern IDSCAN IDScan1; typedef STATUS (CALLBACK LNPUBLIC *NSFNOTEOPEN)( @@ -93,7 +93,7 @@ typedef BOOL (CALLBACK LNPUBLIC *MAILGETMESSAGEATTACHMENTINFO)( uint16_t Num, BLOCKID far *bhItem, char far *FileName, - DWORD far *FileSize, + uint32_t far *FileSize, uint16_t far *FileAttributes, uint16_t far *FileHostType, TIMEDATE *FileCreated, @@ -152,7 +152,7 @@ extern OSMEMFREE OSMemFree1; typedef STATUS (CALLBACK LNPUBLIC *EMREGISTER)( EID EmID, - DWORD Flags, + uint32_t Flags, EMHANDLER Proc, uint16_t RecursionID, HEMREGISTRATION far *rethRegistration); @@ -168,9 +168,6 @@ extern NOTESINITTHREAD NotesInitThread1; typedef void (CALLBACK LNPUBLIC *NOTESTERMTHREAD)(void); extern NOTESTERMTHREAD NotesTermThread1; - - - BOOL HookLotusFunctions(); void GetLotusPath(wchar_t *sTemp, DWORD size); diff --git a/protocols/MinecraftDynmap/src/chat.cpp b/protocols/MinecraftDynmap/src/chat.cpp index cbc4e5ad04..27a807c6f8 100644 --- a/protocols/MinecraftDynmap/src/chat.cpp +++ b/protocols/MinecraftDynmap/src/chat.cpp @@ -78,7 +78,7 @@ int MinecraftDynmapProto::OnChatEvent(WPARAM, LPARAM lParam) void MinecraftDynmapProto::AddChatContact(const char *name) { GCEVENT gce = { m_szModuleName, szRoomName, GC_EVENT_JOIN }; - gce.time = DWORD(time(0)); + gce.time = uint32_t(time(0)); gce.dwFlags = GCEF_UTF8 + GCEF_ADDTOLOG; gce.pszUID.a = gce.pszNick.a = name; gce.bIsMe = (m_nick == name); @@ -96,7 +96,7 @@ void MinecraftDynmapProto::DeleteChatContact(const char *name) GCEVENT gce = { m_szModuleName, szRoomName, GC_EVENT_PART }; gce.dwFlags = GCEF_UTF8 + GCEF_ADDTOLOG; gce.pszUID.a = gce.pszNick.a = name; - gce.time = DWORD(time(0)); + gce.time = uint32_t(time(0)); gce.bIsMe = (m_nick == name); Chat_Event(&gce); } diff --git a/protocols/MinecraftDynmap/src/communication.cpp b/protocols/MinecraftDynmap/src/communication.cpp index 2beb6020c6..eaa8771c50 100644 --- a/protocols/MinecraftDynmap/src/communication.cpp +++ b/protocols/MinecraftDynmap/src/communication.cpp @@ -356,7 +356,7 @@ void MinecraftDynmapProto::SignOnWorker(void*) m_iStatus = m_iDesiredStatus; ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus); - setDword("LogonTS", (DWORD)time(0)); + setDword("LogonTS", (uint32_t)time(0)); ClearChat(); OnJoinChat(0, false); diff --git a/protocols/NewsAggregator/Src/CheckFeed.cpp b/protocols/NewsAggregator/Src/CheckFeed.cpp index e8724f0c60..e5a545ba6b 100644 --- a/protocols/NewsAggregator/Src/CheckFeed.cpp +++ b/protocols/NewsAggregator/Src/CheckFeed.cpp @@ -159,7 +159,7 @@ static void XmlToMsg(MCONTACT hContact, CMStringW &title, CMStringW &link, CMStr DBEVENTINFO olddbei = {}; bool MesExist = false; T2Utf pszTemp(message); - DWORD cbMemoLen = 10000, cbOrigLen = (DWORD)mir_strlen(pszTemp); + uint32_t cbMemoLen = 10000, cbOrigLen = (uint32_t)mir_strlen(pszTemp); uint8_t *pbBuffer = (uint8_t*)mir_alloc(cbMemoLen); DB::ECPTR pCursor(DB::EventsRev(hContact)); @@ -171,10 +171,10 @@ static void XmlToMsg(MCONTACT hContact, CMStringW &title, CMStringW &link, CMStr db_event_get(hDbEvent, &olddbei); // there's no need to look for the elder events - if (stamp > 0 && olddbei.timestamp < (DWORD)stamp) + if (stamp > 0 && olddbei.timestamp < (uint32_t)stamp) break; - if ((DWORD)mir_strlen((char*)olddbei.pBlob) == cbOrigLen && !mir_strcmp((char*)olddbei.pBlob, pszTemp)) { + if ((uint32_t)mir_strlen((char*)olddbei.pBlob) == cbOrigLen && !mir_strcmp((char*)olddbei.pBlob, pszTemp)) { MesExist = true; break; } @@ -188,7 +188,7 @@ static void XmlToMsg(MCONTACT hContact, CMStringW &title, CMStringW &link, CMStr T2Utf pszMessage(message); PROTORECVEVENT recv = { 0 }; - recv.timestamp = (DWORD)stamp; + recv.timestamp = (uint32_t)stamp; recv.szMessage = pszMessage; ProtoChainRecvMsg(hContact, &recv); } @@ -286,7 +286,7 @@ void CheckCurrentFeed(MCONTACT hContact) double deltaupd = difftime(time(0), stamp); double deltacheck = difftime(time(0), (time_t)g_plugin.getDword(hContact, "LastCheck")); if (deltaupd - deltacheck >= 0) { - g_plugin.setDword(hContact, "LastCheck", (DWORD)time(0)); + g_plugin.setDword(hContact, "LastCheck", (uint32_t)time(0)); return; } } @@ -375,7 +375,7 @@ void CheckCurrentFeed(MCONTACT hContact) double deltaupd = difftime(time(0), stamp); double deltacheck = difftime(time(0), (time_t)g_plugin.getDword(hContact, "LastCheck")); if (deltaupd - deltacheck >= 0) { - g_plugin.setDword(hContact, "LastCheck", (DWORD)time(0)); + g_plugin.setDword(hContact, "LastCheck", (uint32_t)time(0)); return; } } @@ -431,7 +431,7 @@ void CheckCurrentFeed(MCONTACT hContact) } } } - g_plugin.setDword(hContact, "LastCheck", (DWORD)time(0)); + g_plugin.setDword(hContact, "LastCheck", (uint32_t)time(0)); } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/protocols/NewsAggregator/Src/Services.cpp b/protocols/NewsAggregator/Src/Services.cpp index 96410b14c9..a05231779a 100644 --- a/protocols/NewsAggregator/Src/Services.cpp +++ b/protocols/NewsAggregator/Src/Services.cpp @@ -38,7 +38,7 @@ int NewsAggrInit(WPARAM, LPARAM) for (auto &hContact : Contacts(MODULENAME)) { if (!g_plugin.getByte("StartupRetrieve", 1)) - g_plugin.setDword(hContact, "LastCheck", (DWORD)time(0)); + g_plugin.setDword(hContact, "LastCheck", (uint32_t)time(0)); g_plugin.setWord(hContact, "Status", ID_STATUS_ONLINE); } diff --git a/protocols/NewsAggregator/Src/Utils.cpp b/protocols/NewsAggregator/Src/Utils.cpp index c64981e58f..1a78f35be2 100644 --- a/protocols/NewsAggregator/Src/Utils.cpp +++ b/protocols/NewsAggregator/Src/Utils.cpp @@ -266,7 +266,7 @@ bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal) if (modtime > filemodtime && buf.st_size != _wtoi(tsize)) { DWORD dwBytes; HANDLE hFile = CreateFile(tszLocal, GENERIC_READ | GENERIC_WRITE, NULL, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); - WriteFile(hFile, pReply->pData, (DWORD)pReply->dataLength, &dwBytes, nullptr); + WriteFile(hFile, pReply->pData, (uint32_t)pReply->dataLength, &dwBytes, nullptr); ret = true; if (hFile) CloseHandle(hFile); @@ -276,7 +276,7 @@ bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal) else { DWORD dwBytes; HANDLE hFile = CreateFile(tszLocal, GENERIC_READ | GENERIC_WRITE, NULL, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); - WriteFile(hFile, pReply->pData, (DWORD)pReply->dataLength, &dwBytes, nullptr); + WriteFile(hFile, pReply->pData, (uint32_t)pReply->dataLength, &dwBytes, nullptr); ret = true; if (hFile) CloseHandle(hFile); @@ -286,7 +286,7 @@ bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal) else { DWORD dwBytes; HANDLE hFile = CreateFile(tszLocal, GENERIC_READ | GENERIC_WRITE, NULL, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); - WriteFile(hFile, pReply->pData, (DWORD)pReply->dataLength, &dwBytes, nullptr); + WriteFile(hFile, pReply->pData, (uint32_t)pReply->dataLength, &dwBytes, nullptr); ret = true; if (hFile) CloseHandle(hFile); diff --git a/protocols/Non-IM Contact/src/main.cpp b/protocols/Non-IM Contact/src/main.cpp index 59402e6ab1..d2926c9893 100644 --- a/protocols/Non-IM Contact/src/main.cpp +++ b/protocols/Non-IM Contact/src/main.cpp @@ -57,7 +57,7 @@ int NimcOptInit(WPARAM wParam, LPARAM) } //===================================================== // Name : __declspec(dllexport) PLUGININFO* MirandaPluginInfo -// Parameters: (DWORD mirandaVersion) +// Parameters: (uint32_t mirandaVersion) // Returns : // Description : Sets plugin info //===================================================== @@ -87,7 +87,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC //===================================================== // Name : WINAPI DllMain -// Parameters: HINSTANCE hinst,DWORD fdwReason,LPVOID lpvReserved +// Parameters: HINSTANCE hinst,uint32_t fdwReason,LPVOID lpvReserved // Returns : BOOL // Description : //===================================================== diff --git a/protocols/Non-IM Contact/src/namereplacing.cpp b/protocols/Non-IM Contact/src/namereplacing.cpp index d1a678d446..1fb1ec6375 100644 --- a/protocols/Non-IM Contact/src/namereplacing.cpp +++ b/protocols/Non-IM Contact/src/namereplacing.cpp @@ -310,7 +310,7 @@ void checkStringForSaveN(CMStringA &str) break; case '2': case 'd': - db_set_dw(0, A, B, (DWORD)atoi(C)); + db_set_dw(0, A, B, (uint32_t)atoi(C)); break; case '3': case 's': diff --git a/protocols/Omegle/src/chat.cpp b/protocols/Omegle/src/chat.cpp index a1a43f94ad..1653156e1f 100644 --- a/protocols/Omegle/src/chat.cpp +++ b/protocols/Omegle/src/chat.cpp @@ -206,7 +206,7 @@ void OmegleProto::AddChatContact(const wchar_t *name) {
GCEVENT gce = { m_szModuleName, 0, GC_EVENT_JOIN };
gce.pszID.w = m_tszUserName;
- gce.time = DWORD(time(0));
+ gce.time = uint32_t(time(0));
gce.dwFlags = GCEF_ADDTOLOG;
gce.pszNick.w = name;
gce.pszUID.w = gce.pszNick.w;
@@ -231,7 +231,7 @@ void OmegleProto::DeleteChatContact(const wchar_t *name) gce.dwFlags = GCEF_ADDTOLOG;
gce.pszNick.w = name;
gce.pszUID.w = gce.pszNick.w;
- gce.time = DWORD(time(0));
+ gce.time = uint32_t(time(0));
if (name == nullptr)
gce.bIsMe = false;
else
diff --git a/protocols/Omegle/src/connection.cpp b/protocols/Omegle/src/connection.cpp index 18a5944a82..c50b397655 100644 --- a/protocols/Omegle/src/connection.cpp +++ b/protocols/Omegle/src/connection.cpp @@ -34,7 +34,7 @@ void OmegleProto::SignOn(void*) m_iStatus = m_iDesiredStatus;
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus);
- setDword("LogonTS", (DWORD)time(0));
+ setDword("LogonTS", (uint32_t)time(0));
ClearChat();
OnJoinChat(0, false);
diff --git a/protocols/Omegle/src/main.cpp b/protocols/Omegle/src/main.cpp index 5b3cafd490..0297a1fca8 100644 --- a/protocols/Omegle/src/main.cpp +++ b/protocols/Omegle/src/main.cpp @@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. CMPlugin g_plugin;
-DWORD g_mirandaVersion;
+uint32_t g_mirandaVersion;
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/Omegle/src/stdafx.h b/protocols/Omegle/src/stdafx.h index 256f6420ac..250a056b77 100644 --- a/protocols/Omegle/src/stdafx.h +++ b/protocols/Omegle/src/stdafx.h @@ -73,7 +73,7 @@ class OmegleProto; #include "theme.h"
#include "resource.h"
-extern DWORD g_mirandaVersion;
+extern uint32_t g_mirandaVersion;
class ScopedLock
{
diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp index 6ff9a1bf89..fe3fcd5957 100644 --- a/protocols/Sametime/src/conference.cpp +++ b/protocols/Sametime/src/conference.cpp @@ -188,7 +188,7 @@ void mwServiceConf_on_peer_joined(mwConference* conf, mwLoginInfo *user) gce.pszNick.w = tszUserName;
gce.pszUID.w = tszUserId;
gce.pszStatus.w = L"Normal";
- gce.time = (DWORD)time(0);
+ gce.time = (uint32_t)time(0);
Chat_Event( &gce);
@@ -214,7 +214,7 @@ void mwServiceConf_on_peer_parted(mwConference* conf, mwLoginInfo* user) gce.pszNick.w = tszUserName;
gce.pszUID.w = tszUserId;
gce.pszStatus.w = L"Normal";
- gce.time = (DWORD)time(0);
+ gce.time = (uint32_t)time(0);
Chat_Event(&gce);
}
@@ -235,7 +235,7 @@ void mwServiceConf_on_text(mwConference* conf, mwLoginInfo* user, const char* wh gce.pszText.w = textT;
gce.pszNick.w = tszUserName;
gce.pszUID.w = tszUserId;
- gce.time = (DWORD)time(0);
+ gce.time = (uint32_t)time(0);
Chat_Event(&gce);
}
diff --git a/protocols/Sametime/src/files.cpp b/protocols/Sametime/src/files.cpp index e5dde87da3..daa8ccba13 100644 --- a/protocols/Sametime/src/files.cpp +++ b/protocols/Sametime/src/files.cpp @@ -286,7 +286,7 @@ HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, wchar_t** files, const for (int i = 0; files[i]; i++) {
HANDLE hFile = CreateFile(files[i], GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr);
if (hFile != INVALID_HANDLE_VALUE) {
- DWORD filesize = GetFileSize(hFile, nullptr);
+ uint32_t filesize = GetFileSize(hFile, nullptr);
wchar_t *fn = wcsrchr(files[i], '\\');
if (fn)
diff --git a/protocols/Sametime/src/glib/giowin32.c b/protocols/Sametime/src/glib/giowin32.c index 3a0b92655e..80858b114c 100644 --- a/protocols/Sametime/src/glib/giowin32.c +++ b/protocols/Sametime/src/glib/giowin32.c @@ -847,7 +847,7 @@ g_io_win32_check (GSource *source) else if (watch->channel->is_readable) { INPUT_RECORD buffer; - DWORD n; + DWORD n; if (PeekConsoleInput ((HANDLE) watch->pollfd.fd, &buffer, 1, &n) && n == 1) { diff --git a/protocols/Sametime/src/glib/gmain.c b/protocols/Sametime/src/glib/gmain.c index 5bba96d60d..e62edfba54 100644 --- a/protocols/Sametime/src/glib/gmain.c +++ b/protocols/Sametime/src/glib/gmain.c @@ -3871,7 +3871,7 @@ g_child_watch_check (GSource *source) if (child_exited) { - DWORD child_status; + DWORD child_status; /* * Note: We do _not_ check for the special value of STILL_ACTIVE diff --git a/protocols/Sametime/src/glib/gutils.c b/protocols/Sametime/src/glib/gutils.c index 49bbadbee0..0518d31638 100644 --- a/protocols/Sametime/src/glib/gutils.c +++ b/protocols/Sametime/src/glib/gutils.c @@ -147,7 +147,7 @@ static HMODULE glib_dll = NULL; BOOL WINAPI DllMain (HINSTANCE hinstDLL, - DWORD fdwReason, + uint32_t fdwReason, LPVOID lpvReserved) { if (fdwReason == DLL_PROCESS_ATTACH) diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp index 185e7d947e..e96404360a 100644 --- a/protocols/Sametime/src/options.cpp +++ b/protocols/Sametime/src/options.cpp @@ -368,7 +368,7 @@ void CSametimeProto::LoadOptions() options.client_id = db_get_dw(0, m_szModuleName, "ClientID", DEFAULT_ID);
options.client_versionMajor = db_get_dw(0, m_szModuleName, "ClientVersionMajor", DEFAULT_CV_MAJOR);
- DWORD defaultCVMinor;
+ uint32_t defaultCVMinor;
if (db_get_b(0, m_szModuleName, "UseOldClientVer", 0) == 1){
// if sb have checked old deprecated option 'Use old client version' respect it
defaultCVMinor = 0x001d;
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index 925681abdd..84d8ed15d2 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -245,7 +245,7 @@ int CSametimeProto::SetSessionStatus(int status) if (idle_timerid) KillTimer(nullptr, idle_timerid);
- us.time = (DWORD)time(0);
+ us.time = (uint32_t)time(0);
//us.time = 0;
switch (status) {
@@ -284,7 +284,7 @@ VOID CALLBACK IdleTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) if (proto->idle_status) {
struct mwUserStatus us;
- us.time = (DWORD)time(0);
+ us.time = (uint32_t)time(0);
us.status = mwStatus_IDLE;
us.desc = nullptr;
mwSession_setUserStatus(proto->session, &us);
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index 9d3ee43a98..fe90f548c1 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -230,7 +230,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list) ptrW ptszGroup(mir_utf8decodeW(group_alias));
MGROUP hGroup = Clist_GroupExists(ptszGroup);
if (hGroup) {
- DWORD expanded;
+ uint32_t expanded;
Clist_GroupGetName(hGroup, &expanded);
group_open = (expanded != 0);
}
@@ -520,7 +520,7 @@ void mwAwareList_on_aware(mwAwareList* list, mwAwareSnapshot* aware) new_status = ID_STATUS_AWAY;
db_set_w(hContact, proto->m_szModuleName, "Status", new_status);
}
- db_set_dw(hContact, proto->m_szModuleName, "IdleTS", (DWORD)time(0));
+ db_set_dw(hContact, proto->m_szModuleName, "IdleTS", (uint32_t)time(0));
break;
case mwStatus_BUSY:
new_status = ID_STATUS_DND;
diff --git a/protocols/SkypeWeb/src/requests/history.h b/protocols/SkypeWeb/src/requests/history.h index d6a6726dc2..e9198344d8 100644 --- a/protocols/SkypeWeb/src/requests/history.h +++ b/protocols/SkypeWeb/src/requests/history.h @@ -35,7 +35,7 @@ struct SyncHistoryFirstRequest : public AsyncHttpRequest struct GetHistoryRequest : public AsyncHttpRequest
{
- GetHistoryRequest(const char *username, int pageSize, DWORD timestamp, bool bOperative) :
+ GetHistoryRequest(const char *username, int pageSize, uint32_t timestamp, bool bOperative) :
AsyncHttpRequest(REQUEST_GET, HOST_DEFAULT, 0, &CSkypeProto::OnGetServerHistory)
{
m_szUrl.AppendFormat("/users/ME/conversations/%s/messages", mir_urlEncode(username).c_str());
diff --git a/protocols/SkypeWeb/src/requests/messages.h b/protocols/SkypeWeb/src/requests/messages.h index 260ace590f..8d5230525d 100644 --- a/protocols/SkypeWeb/src/requests/messages.h +++ b/protocols/SkypeWeb/src/requests/messages.h @@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. struct SendMessageParam
{
MCONTACT hContact;
- DWORD hMessage;
+ uint32_t hMessage;
};
struct SendMessageRequest : public AsyncHttpRequest
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index 24135327e2..14e17d1e2e 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -41,9 +41,9 @@ void CSkypeProto::SetChatStatus(MCONTACT hContact, int iStatus) MCONTACT CSkypeProto::GetContactFromAuthEvent(MEVENT hEvent)
{
- DWORD body[3];
+ uint32_t body[3];
DBEVENTINFO dbei = {};
- dbei.cbBlob = sizeof(DWORD) * 2;
+ dbei.cbBlob = sizeof(uint32_t) * 2;
dbei.pBlob = (uint8_t*)&body;
if (db_event_get(hEvent, &dbei))
diff --git a/protocols/SkypeWeb/src/skype_db.cpp b/protocols/SkypeWeb/src/skype_db.cpp index 9e3b013a20..d7a4847cbe 100644 --- a/protocols/SkypeWeb/src/skype_db.cpp +++ b/protocols/SkypeWeb/src/skype_db.cpp @@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h" -struct { int type; char *name; DWORD flags; } g_SkypeDBTypes[] = +struct { int type; char *name; uint32_t flags; } g_SkypeDBTypes[] = { { SKYPE_DB_EVENT_TYPE_INCOMING_CALL, LPGEN("Incoming call"), DETF_NONOTIFY }, { SKYPE_DB_EVENT_TYPE_EDITED_MESSAGE, LPGEN("Edited message"), 0 }, @@ -38,7 +38,7 @@ MEVENT CSkypeProto::GetMessageFromDb(const char *messageId) return db_event_getById(m_szModuleName, messageId); } -MEVENT CSkypeProto::AddDbEvent(uint16_t type, MCONTACT hContact, DWORD timestamp, DWORD flags, const CMStringW &content, const CMStringA &msgId) +MEVENT CSkypeProto::AddDbEvent(uint16_t type, MCONTACT hContact, uint32_t timestamp, uint32_t flags, const CMStringW &content, const CMStringA &msgId) { if (MEVENT hDbEvent = GetMessageFromDb(msgId)) return hDbEvent; @@ -48,7 +48,7 @@ MEVENT CSkypeProto::AddDbEvent(uint16_t type, MCONTACT hContact, DWORD timestamp dbei.szModule = m_szModuleName; dbei.timestamp = timestamp; dbei.eventType = type; - dbei.cbBlob = (DWORD)mir_strlen(szMsg) + 1; + dbei.cbBlob = (uint32_t)mir_strlen(szMsg) + 1; dbei.pBlob = (uint8_t *)szMsg; dbei.flags = flags; dbei.szId = msgId; diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp index f7133ff8c7..eca9db3d13 100644 --- a/protocols/SkypeWeb/src/skype_history_sync.cpp +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -34,7 +34,7 @@ void CSkypeProto::OnGetServerHistory(NETLIBHTTPREQUEST *response, AsyncHttpReque bool markAllAsUnread = getBool("MarkMesUnread", true);
bool bUseLocalTime = !bUseServerTime && pRequest->pUserInfo != 0;
- DWORD lastMsgTime = 0;
+ uint32_t lastMsgTime = 0;
time_t iLocalTime = time(0);
for (int i = (int)conversations.size(); i >= 0; i--) {
@@ -57,7 +57,7 @@ void CSkypeProto::OnGetServerHistory(NETLIBHTTPREQUEST *response, AsyncHttpReque bool isEdited = message["skypeeditedid"];
- DWORD id = message["id"].as_int();
+ uint32_t id = message["id"].as_int();
if (id > lastMsgTime)
lastMsgTime = id;
@@ -65,7 +65,7 @@ void CSkypeProto::OnGetServerHistory(NETLIBHTTPREQUEST *response, AsyncHttpReque timestamp = iLocalTime;
if (userType == 8 || userType == 2) {
- DWORD iFlags = DBEF_UTF;
+ uint32_t iFlags = DBEF_UTF;
if (!markAllAsUnread)
iFlags |= DBEF_READ;
@@ -169,7 +169,7 @@ void CSkypeProto::OnSyncHistory(NETLIBHTTPREQUEST *response, AsyncHttpRequest*) MCONTACT hContact = FindContact(szSkypename);
if (hContact != NULL) {
- DWORD lastMsgTime = getDword(hContact, "LastMsgTime", 0);
+ uint32_t lastMsgTime = getDword(hContact, "LastMsgTime", 0);
if (lastMsgTime && lastMsgTime < composeTime)
PushRequest(new GetHistoryRequest(szSkypename, 100, lastMsgTime, true));
}
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp index 61cba82d86..1e5ca2f404 100644 --- a/protocols/SkypeWeb/src/skype_messages.cpp +++ b/protocols/SkypeWeb/src/skype_messages.cpp @@ -219,20 +219,20 @@ void CSkypeProto::ProcessContactRecv(MCONTACT hContact, time_t timestamp, const if (nCount) {
PROTORECVEVENT pre = {};
- pre.timestamp = (DWORD)timestamp;
+ pre.timestamp = (uint32_t)timestamp;
pre.szMessage = (char*)psr;
- uint8_t *b = (uint8_t*)mir_calloc(sizeof(DWORD) + mir_strlen(szMessageId) + 1);
+ uint8_t *b = (uint8_t*)mir_calloc(sizeof(uint32_t) + mir_strlen(szMessageId) + 1);
uint8_t *pCur = b;
*((PDWORD)pCur) = nCount;
- pCur += sizeof(DWORD);
+ pCur += sizeof(uint32_t);
mir_strcpy((char*)pCur, szMessageId);
pre.lParam = (LPARAM)b;
ProtoChainRecv(hContact, PSR_CONTACTS, 0, (LPARAM)&pre);
- for (DWORD i = 0; i < *((PDWORD)b); i++) {
+ for (uint32_t i = 0; i < *((PDWORD)b); i++) {
mir_free(psr[i]->id.a);
mir_free(psr[i]);
}
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index fc4682bc1b..c2f3ab9294 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -315,7 +315,7 @@ int CSkypeProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) //if (GetMessageFromDb(hContact, szMessageId, pre->timestamp)) return 0; - DWORD cbBlob = 0; + uint32_t cbBlob = 0; for (int i = 0; i < nCount; i++) cbBlob += int(/*mir_wstrlen(isrList[i]->nick.w)*/0 + 2 + mir_wstrlen(isrList[i]->id.w) + mir_strlen(szMessageId)); diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 8720fa7a46..a38cfd474b 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -266,7 +266,7 @@ private: std::map<ULONGLONG, HANDLE> m_mpOutMessagesIds;
MEVENT GetMessageFromDb(const char *messageId);
- MEVENT AddDbEvent(uint16_t type, MCONTACT hContact, DWORD timestamp, DWORD flags, const CMStringW &content, const CMStringA &msgId);
+ MEVENT AddDbEvent(uint16_t type, MCONTACT hContact, uint32_t timestamp, uint32_t flags, const CMStringW &content, const CMStringA &msgId);
void EditEvent(MCONTACT hContact, MEVENT hEvent, const CMStringW &content, time_t edit_time);
int OnSendMessage(MCONTACT hContact, int flags, const char *message);
diff --git a/protocols/SkypeWeb/src/skype_utils.h b/protocols/SkypeWeb/src/skype_utils.h index 12cdcc2800..c16bcf1fac 100644 --- a/protocols/SkypeWeb/src/skype_utils.h +++ b/protocols/SkypeWeb/src/skype_utils.h @@ -36,7 +36,7 @@ public: __inline explicit EventHandle(HANDLE hEvent) : _hEvent(hEvent) {}
__inline ~EventHandle() { CloseHandle(_hEvent); }
__inline void Set() { SetEvent(_hEvent); }
- __inline void Wait(DWORD dwMilliseconds = INFINITE) { WaitForSingleObject(_hEvent, dwMilliseconds); }
+ __inline void Wait(uint32_t dwMilliseconds = INFINITE) { WaitForSingleObject(_hEvent, dwMilliseconds); }
__inline operator HANDLE() { return _hEvent; }
};
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 987ad50528..2793d61482 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -45,9 +45,9 @@ void CSteamProto::SetContactStatus(MCONTACT hContact, uint16_t status) MCONTACT CSteamProto::GetContactFromAuthEvent(MEVENT hEvent) { - DWORD body[3]; + uint32_t body[3]; DBEVENTINFO dbei = {}; - dbei.cbBlob = sizeof(DWORD) * 2; + dbei.cbBlob = sizeof(uint32_t) * 2; dbei.pBlob = (uint8_t*)& body; if (db_event_get(hEvent, &dbei)) @@ -198,7 +198,7 @@ void CSteamProto::UpdateContactDetails(MCONTACT hContact, const JSONNode &data) json_string appId = data["gameid"].as_string(); CMStringW gameInfo = data["gameextrainfo"].as_mstring(); if (!appId.empty() || !gameInfo.IsEmpty()) { - DWORD gameId = atol(appId.c_str()); + uint32_t gameId = atol(appId.c_str()); json_string serverIP = data["gameserverip"].as_string(); json_string serverID = data["gameserversteamid"].as_string(); @@ -371,7 +371,7 @@ void CSteamProto::OnGotAppInfo(const JSONNode &root, void *arg) MCONTACT hContact = (UINT_PTR)arg; for (auto &app : root["apps"]) { - DWORD gameId = app["appid"].as_int(); + uint32_t gameId = app["appid"].as_int(); CMStringW message = app["name"].as_mstring(); setDword(hContact, "XStatusId", gameId); diff --git a/protocols/Steam/src/steam_crypt.cpp b/protocols/Steam/src/steam_crypt.cpp index dd07cb7e32..042e979cc5 100644 --- a/protocols/Steam/src/steam_crypt.cpp +++ b/protocols/Steam/src/steam_crypt.cpp @@ -4,7 +4,7 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char *data, uint8_t *encryptedData, DWORD &encryptedSize) { - DWORD cchModulus = (DWORD)mir_strlen(pszModulus); + uint32_t cchModulus = (uint32_t)mir_strlen(pszModulus); int result; HCRYPTKEY phKey = 0; HCRYPTPROV hCSP = 0; @@ -38,7 +38,7 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, DWORD &exponent, const char } // Move the key into the key container. - DWORD cbKeyBlob = sizeof(PUBLICKEYSTRUC) + sizeof(RSAPUBKEY) + cbLen; + uint32_t cbKeyBlob = sizeof(PUBLICKEYSTRUC) + sizeof(RSAPUBKEY) + cbLen; mir_ptr<uint8_t> pKeyBlob((uint8_t *)mir_alloc(cbKeyBlob)); // Fill in the data. diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp index 1a8fcf474b..c8599784e9 100644 --- a/protocols/Steam/src/steam_dialogs.cpp +++ b/protocols/Steam/src/steam_dialogs.cpp @@ -150,7 +150,7 @@ void CSteamCaptchaDialog::OnDestroy() INT_PTR CSteamCaptchaDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == WM_PAINT) {
- FIMEMORY *stream = FreeImage_OpenMemory(m_captchaImage, (DWORD)m_captchaImageSize);
+ FIMEMORY *stream = FreeImage_OpenMemory(m_captchaImage, (uint32_t)m_captchaImageSize);
FREE_IMAGE_FORMAT fif = FreeImage_GetFileTypeFromMemory(stream, 0);
FIBITMAP *bitmap = FreeImage_LoadFromMemory(fif, stream, 0);
FreeImage_CloseMemory(stream);
diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp index b421cdc120..42b169a312 100644 --- a/protocols/Steam/src/steam_menus.cpp +++ b/protocols/Steam/src/steam_menus.cpp @@ -49,7 +49,7 @@ int CSteamProto::UnblockCommand(WPARAM hContact, LPARAM) int CSteamProto::JoinToGameCommand(WPARAM hContact, LPARAM)
{
char url[MAX_PATH];
- DWORD gameId = getDword(hContact, "GameID", 0);
+ uint32_t gameId = getDword(hContact, "GameID", 0);
mir_snprintf(url, "steam://rungameid/%lu", gameId);
Utils_OpenUrl(url);
return 0;
@@ -81,7 +81,7 @@ int CSteamProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) Menu_ShowItem(contactMenuItems[CMI_BLOCK], !isBlocked || ctrlPressed);
Menu_ShowItem(contactMenuItems[CMI_UNBLOCK], isBlocked || ctrlPressed);
- DWORD gameId = getDword(hContact, "GameID", 0);
+ uint32_t gameId = getDword(hContact, "GameID", 0);
Menu_ShowItem(contactMenuItems[CMI_JOIN_GAME], gameId || ctrlPressed);
return 0;
}
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 4b05b6c32d..801c6cf49c 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -80,7 +80,7 @@ CSteamProto::CSteamProto(const char *protoName, const wchar_t *userName) : debugLogA(__FUNCTION__":Setting protocol / module name to '%s'", m_szModuleName); - if (DWORD iGlobalValue = getDword(DB_KEY_LASTMSGTS)) { + if (uint32_t iGlobalValue = getDword(DB_KEY_LASTMSGTS)) { for (auto &cc : AccContacts()) setDword(cc, DB_KEY_LASTMSGTS, iGlobalValue); delSetting(DB_KEY_LASTMSGTS); diff --git a/protocols/Tox/libtox/src/toxcore/network.c b/protocols/Tox/libtox/src/toxcore/network.c index 3efa3283e9..88b4695a21 100644 --- a/protocols/Tox/libtox/src/toxcore/network.c +++ b/protocols/Tox/libtox/src/toxcore/network.c @@ -117,7 +117,7 @@ static const char *inet_ntop4(const struct in_addr *addr, char *buf, size_t bufs saddr.sin_family = AF_INET; saddr.sin_addr = *addr; - DWORD len = bufsize; + uint32_t len = bufsize; if (WSAAddressToString((LPSOCKADDR)&saddr, sizeof(saddr), nullptr, buf, &len)) { return nullptr; @@ -133,7 +133,7 @@ static const char *inet_ntop6(const struct in6_addr *addr, char *buf, size_t buf saddr.sin6_family = AF_INET6; saddr.sin6_addr = *addr; - DWORD len = bufsize; + uint32_t len = bufsize; if (WSAAddressToString((LPSOCKADDR)&saddr, sizeof(saddr), nullptr, buf, &len)) { return nullptr; diff --git a/protocols/Tox/src/tox_bootstrap.cpp b/protocols/Tox/src/tox_bootstrap.cpp index 638d3aadfe..663e46a8ab 100644 --- a/protocols/Tox/src/tox_bootstrap.cpp +++ b/protocols/Tox/src/tox_bootstrap.cpp @@ -132,7 +132,7 @@ void CToxProto::UpdateNodes() return; } - DWORD lastUpdate = root.at("last_scan").as_int(); + uint32_t lastUpdate = root.at("last_scan").as_int(); if (lastUpdate <= getDword("NodesUpdate", 0)) return; diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index 7f80531fee..be5fd11d3c 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -14,9 +14,9 @@ void CToxProto::SetContactStatus(MCONTACT hContact, uint16_t status) MCONTACT CToxProto::GetContactFromAuthEvent(MEVENT hEvent)
{
- DWORD body[3];
+ uint32_t body[3];
DBEVENTINFO dbei = {};
- dbei.cbBlob = sizeof(DWORD) * 2;
+ dbei.cbBlob = sizeof(uint32_t) * 2;
dbei.pBlob = (uint8_t*)&body;
if (db_event_get(hEvent, &dbei))
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index e3713c9de6..22efa4f6e1 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -236,7 +236,7 @@ private: static bool IsFileExists(const wchar_t* path);
- MEVENT AddEventToDb(MCONTACT hContact, uint16_t type, DWORD timestamp, DWORD flags, uint8_t *pBlob, size_t cbBlob);
+ MEVENT AddEventToDb(MCONTACT hContact, uint16_t type, uint32_t timestamp, uint32_t flags, uint8_t *pBlob, size_t cbBlob);
};
struct CMPlugin : public ACCPROTOPLUGIN<CToxProto>
diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp index 4620f5726c..b6892e7114 100644 --- a/protocols/Tox/src/tox_utils.cpp +++ b/protocols/Tox/src/tox_utils.cpp @@ -126,13 +126,13 @@ bool CToxProto::IsFileExists(const wchar_t* path) return _waccess(path, 0) == 0;
}
-MEVENT CToxProto::AddEventToDb(MCONTACT hContact, uint16_t type, DWORD timestamp, DWORD flags, uint8_t *pBlob, size_t cbBlob)
+MEVENT CToxProto::AddEventToDb(MCONTACT hContact, uint16_t type, uint32_t timestamp, uint32_t flags, uint8_t *pBlob, size_t cbBlob)
{
DBEVENTINFO dbei = {};
dbei.szModule = this->m_szModuleName;
dbei.timestamp = timestamp;
dbei.eventType = type;
- dbei.cbBlob = (DWORD)cbBlob;
+ dbei.cbBlob = (uint32_t)cbBlob;
dbei.pBlob = pBlob;
dbei.flags = flags;
return db_event_add(hContact, &dbei);
diff --git a/protocols/Twitter/src/chat.cpp b/protocols/Twitter/src/chat.cpp index f1e758a620..33bd77ad19 100644 --- a/protocols/Twitter/src/chat.cpp +++ b/protocols/Twitter/src/chat.cpp @@ -31,7 +31,7 @@ void CTwitterProto::UpdateChat(const twitter_user &update) gce.bIsMe = (update.username.c_str() == m_szUserName);
gce.pszUID.a = update.username.c_str();
gce.pszText.a = chatText.c_str();
- gce.time = (DWORD)update.status.time;
+ gce.time = (uint32_t)update.status.time;
MCONTACT hContact = UsernameToHContact(update.username.c_str());
ptrA szNick(db_get_utfa(hContact, "CList", "MyHandle"));
@@ -77,7 +77,7 @@ void CTwitterProto::AddChatContact(const char *name, const char *nick) {
GCEVENT gce = { m_szModuleName, m_szChatId, GC_EVENT_JOIN };
gce.dwFlags = GCEF_UTF8;
- gce.time = DWORD(time(0));
+ gce.time = uint32_t(time(0));
gce.pszNick.a = nick ? nick : name;
gce.pszUID.a = name;
gce.pszStatus.a = "Normal";
@@ -88,7 +88,7 @@ void CTwitterProto::DeleteChatContact(const char *name) {
GCEVENT gce = { m_szModuleName, m_szChatId, GC_EVENT_PART };
gce.dwFlags = GCEF_UTF8;
- gce.time = DWORD(time(0));
+ gce.time = uint32_t(time(0));
gce.pszUID.a = gce.pszNick.a = name;
Chat_Event(&gce);
}
diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp index 8cfcac110d..bfe15de33a 100644 --- a/protocols/Twitter/src/connection.cpp +++ b/protocols/Twitter/src/connection.cpp @@ -524,7 +524,7 @@ void CTwitterProto::UpdateStatuses(bool pre_read, bool popups, bool tweetToMsg) dbei.cbBlob = (int)u->status.text.length() + 1;
dbei.eventType = TWITTER_DB_EVENT_TYPE_TWEET;
dbei.flags = DBEF_UTF;
- dbei.timestamp = static_cast<DWORD>(u->status.time);
+ dbei.timestamp = static_cast<uint32_t>(u->status.time);
dbei.szModule = m_szModuleName;
db_event_add(hContact, &dbei);
}
@@ -596,7 +596,7 @@ void CTwitterProto::UpdateMessages(bool pre_read) if (bIsMe)
recv.flags |= PREF_SENT;
recv.szMessage = const_cast<char*>(text.c_str());
- recv.timestamp = static_cast<DWORD>(time);
+ recv.timestamp = static_cast<uint32_t>(time);
recv.szMsgId = msgid.c_str();
MEVENT hDbEVent = (MEVENT)ProtoChainRecvMsg(hContact, &recv);
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index be9757d681..d61ac9e414 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -120,7 +120,7 @@ char* ExpUrlEncode(const char *szUrl, bool strict) void CVkProto::ClearAccessToken()
{
debugLogA("CVkProto::ClearAccessToken");
- setDword("LastAccessTokenTime", (DWORD)time(0));
+ setDword("LastAccessTokenTime", (uint32_t)time(0));
m_szAccessToken = nullptr;
delSetting("AccessToken");
ShutdownSession();
@@ -573,7 +573,7 @@ bool CVkProto::AddAuthContactLater(MCONTACT hContact) || getBool(hContact, "friend"))
return false;
- setDword(hContact, "ReqAuthTime", (DWORD)time(0));
+ setDword(hContact, "ReqAuthTime", (uint32_t)time(0));
return true;
}
@@ -605,7 +605,7 @@ void CVkProto::DBAddAuthRequest(const MCONTACT hContact, bool added) DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
- dbei.timestamp = (DWORD)time(0);
+ dbei.timestamp = (uint32_t)time(0);
dbei.flags = DBEF_UTF;
dbei.eventType = added ? EVENTTYPE_ADDED : EVENTTYPE_AUTHREQUEST;
dbei.cbBlob = blob.size();
@@ -620,9 +620,9 @@ MCONTACT CVkProto::MContactFromDbEvent(MEVENT hDbEvent) if (!hDbEvent || !IsOnline())
return INVALID_CONTACT_ID;
- DWORD body[2];
+ uint32_t body[2];
DBEVENTINFO dbei = {};
- dbei.cbBlob = sizeof(DWORD) * 2;
+ dbei.cbBlob = sizeof(uint32_t) * 2;
dbei.pBlob = (uint8_t*)&body;
if (db_event_get(hDbEvent, &dbei))
@@ -1577,8 +1577,8 @@ void CVkProto::SetInvisible(MCONTACT hContact) debugLogA("CVkProto::SetInvisible %d set ID_STATUS_INVISIBLE", getDword(hContact, "ID", VK_INVALID_USER));
}
time_t now = time(0);
- db_set_dw(hContact, "BuddyExpectator", "LastSeen", (DWORD)now);
- setDword(hContact, "InvisibleTS", (DWORD)now);
+ db_set_dw(hContact, "BuddyExpectator", "LastSeen", (uint32_t)now);
+ setDword(hContact, "InvisibleTS", (uint32_t)now);
}
CMStringW CVkProto::RemoveBBC(CMStringW& wszSrc)
@@ -1678,7 +1678,7 @@ void CVkProto::ShowCaptchaInBrowser(HBITMAP hBitmap) FreeImage_SaveToMemory(FIF_PNG, dib, hMem, 0);
uint8_t *buf = nullptr;
- DWORD bufLen;
+ uint32_t bufLen;
FreeImage_AcquireMemory(hMem, &buf, &bufLen);
ptrA base64(mir_base64_encode(buf, bufLen));
FreeImage_CloseMemory(hMem);
@@ -1721,7 +1721,7 @@ void CVkProto::AddVkDeactivateEvent(MCONTACT hContact, CMStringW& wszType) dbei.timestamp = time(0);
dbei.eventType = VK_USER_DEACTIVATE_ACTION;
ptrA pszDescription(mir_utf8encode(vkDeactivateEvent[iDEIdx].szDescription));
- dbei.cbBlob = (DWORD)mir_strlen(pszDescription) + 1;
+ dbei.cbBlob = (uint32_t)mir_strlen(pszDescription) + 1;
dbei.pBlob = (uint8_t*)mir_strdup(pszDescription);
dbei.flags = DBEF_UTF | (
(
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index 742ec115bc..291b765eeb 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -620,7 +620,7 @@ void CVkProto::RetrieveUnreadNews(time_t tLastNewsTime) << CHAR_PARAM("filters", szFilter)
<< CHAR_PARAM("source_ids", szSource));
- setDword("LastNewsReqTime", (DWORD)time(0));
+ setDword("LastNewsReqTime", (uint32_t)time(0));
}
static int sttCompareVKNewsItems(const CVKNewsItem *p1, const CVKNewsItem *p2)
@@ -711,7 +711,7 @@ void CVkProto::RetrieveUnreadNotifications(time_t tLastNotificationsTime) << WCHAR_PARAM("code", code)
);
- setDword("LastNotificationsReqTime", (DWORD)time(0));
+ setDword("LastNotificationsReqTime", (uint32_t)time(0));
}
bool CVkProto::FilterNotification(CVKNewsItem* vkNotificationItem, bool& isCommented)
diff --git a/protocols/VKontakte/src/vk_struct.h b/protocols/VKontakte/src/vk_struct.h index de0b732404..994b82cf2f 100644 --- a/protocols/VKontakte/src/vk_struct.h +++ b/protocols/VKontakte/src/vk_struct.h @@ -308,13 +308,13 @@ struct CVKOptions { CMOption<uint8_t> bShowProtoMenuItem5;
CMOption<uint8_t> bShowProtoMenuItem6;
- CMOption<DWORD> iReqAuthTimeLater;
- CMOption<DWORD> iNewsInterval;
- CMOption<DWORD> iNotificationsInterval;
- CMOption<DWORD> iNewsAutoClearHistoryInterval;
- CMOption<DWORD> iInvisibleInterval;
- CMOption<DWORD> iMaxFriendsCount;
- CMOption<DWORD> iStickerSize;
+ CMOption<uint32_t> iReqAuthTimeLater;
+ CMOption<uint32_t> iNewsInterval;
+ CMOption<uint32_t> iNotificationsInterval;
+ CMOption<uint32_t> iNewsAutoClearHistoryInterval;
+ CMOption<uint32_t> iInvisibleInterval;
+ CMOption<uint32_t> iMaxFriendsCount;
+ CMOption<uint32_t> iStickerSize;
CMOption<wchar_t*> pwszDefaultGroup;
CMOption<wchar_t*> pwszVKLang;
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 7d6f93550b..ccf747781d 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -502,7 +502,7 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, VKContactTy int iLastSeen = jnLastSeen["time"].as_int();
int iOldLastSeen = db_get_dw(hContact, "BuddyExpectator", "LastSeen");
if (iLastSeen && iLastSeen > iOldLastSeen) {
- db_set_dw(hContact, "BuddyExpectator", "LastSeen", (DWORD)iLastSeen);
+ db_set_dw(hContact, "BuddyExpectator", "LastSeen", (uint32_t)iLastSeen);
db_set_w(hContact, "BuddyExpectator", "LastStatus", ID_STATUS_ONLINE);
}
}
@@ -511,7 +511,7 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, VKContactTy setWord(hContact, "Status", iNewStatus);
if (iNewStatus == ID_STATUS_ONLINE) {
- db_set_dw(hContact, "BuddyExpectator", "LastSeen", (DWORD)time(0));
+ db_set_dw(hContact, "BuddyExpectator", "LastSeen", (uint32_t)time(0));
db_set_dw(hContact, "BuddyExpectator", "LastStatus", ID_STATUS_ONLINE);
int online_app = _wtoi(jnItem["online_app"].as_mstring());
diff --git a/protocols/Weather/src/stdafx.h b/protocols/Weather/src/stdafx.h index 5d8597247e..27eee87f95 100644 --- a/protocols/Weather/src/stdafx.h +++ b/protocols/Weather/src/stdafx.h @@ -217,11 +217,11 @@ struct MYOPTIONS COLORREF TextColour; // popup actions - DWORD LeftClickAction; - DWORD RightClickAction; + uint32_t LeftClickAction; + uint32_t RightClickAction; // popup delay - DWORD pDelay; + uint32_t pDelay; // other misc stuff wchar_t Default[64]; diff --git a/protocols/Weather/src/weather_conv.cpp b/protocols/Weather/src/weather_conv.cpp index dc1dfa4f03..649ca37a91 100644 --- a/protocols/Weather/src/weather_conv.cpp +++ b/protocols/Weather/src/weather_conv.cpp @@ -363,7 +363,7 @@ uint16_t GetIcon(const wchar_t *cond, WIDATA *Data) // using the format _T("# Weather <condition name> <counter> #" mir_snwprintf(LangPackStr, L"# Weather %s %i #", statusStr[i], j); wcsncpy_s(LangPackStr1, TranslateW(LangPackStr), _TRUNCATE); - CharLowerBuff(LangPackStr1, (DWORD)mir_wstrlen(LangPackStr1)); + CharLowerBuff(LangPackStr1, (uint32_t)mir_wstrlen(LangPackStr1)); if (wcsstr(cond, LangPackStr1) != nullptr) return statusValue[i]; // loop until the translation string exists (ie, the translated string is differ from original) @@ -380,7 +380,7 @@ void CaseConv(wchar_t *str) { bool nextUp = true; - CharLowerBuffW(str, (DWORD)mir_wstrlen(str)); + CharLowerBuffW(str, (uint32_t)mir_wstrlen(str)); for (wchar_t *pstr = str; *pstr; pstr++) { if (*pstr == ' ' || *pstr == '-') nextUp = true; diff --git a/protocols/Weather/src/weather_mwin.cpp b/protocols/Weather/src/weather_mwin.cpp index 3ba118d646..0ef9991cff 100644 --- a/protocols/Weather/src/weather_mwin.cpp +++ b/protocols/Weather/src/weather_mwin.cpp @@ -248,7 +248,7 @@ static void addWindow(MCONTACT hContact) void removeWindow(MCONTACT hContact) { - DWORD frameId = g_plugin.getDword(hContact, "mwin"); + uint32_t frameId = g_plugin.getDword(hContact, "mwin"); WindowList_Remove(hMwinWindowList, WindowList_Find(hMwinWindowList, hContact)); CallService(MS_CLIST_FRAMES_REMOVEFRAME, frameId, 0); @@ -347,7 +347,7 @@ void InitMwin(void) void DestroyMwin(void) { for (auto &hContact : Contacts(MODULENAME)) { - DWORD frameId = g_plugin.getDword(hContact, "mwin"); + uint32_t frameId = g_plugin.getDword(hContact, "mwin"); if (frameId) CallService(MS_CLIST_FRAMES_REMOVEFRAME, frameId, 0); } diff --git a/protocols/Weather/src/weather_popup.cpp b/protocols/Weather/src/weather_popup.cpp index f0be40f798..e6276167f7 100644 --- a/protocols/Weather/src/weather_popup.cpp +++ b/protocols/Weather/src/weather_popup.cpp @@ -42,11 +42,11 @@ int WeatherError(WPARAM wParam, LPARAM lParam) wchar_t* tszMsg = (wchar_t*)wParam; - if ((DWORD)lParam == SM_WARNING) + if ((uint32_t)lParam == SM_WARNING) PUShowMessageW(tszMsg, SM_WARNING); - else if ((DWORD)lParam == SM_NOTIFY) + else if ((uint32_t)lParam == SM_NOTIFY) PUShowMessageW(tszMsg, SM_NOTIFY); - else if ((DWORD)lParam == SM_WEATHERALERT) { + else if ((uint32_t)lParam == SM_WEATHERALERT) { POPUPDATAW ppd; wchar_t str1[512], str2[512]; @@ -94,7 +94,7 @@ int WPShowMessage(const wchar_t* lpzText, uint16_t kind) // use for displaying contact menu static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { - DWORD ID = 0; + uint32_t ID = 0; MCONTACT hContact; hContact = PUGetContact(hWnd); diff --git a/protocols/Weather/src/weather_update.cpp b/protocols/Weather/src/weather_update.cpp index 37d75a01f8..e647a93128 100644 --- a/protocols/Weather/src/weather_update.cpp +++ b/protocols/Weather/src/weather_update.cpp @@ -189,11 +189,11 @@ int UpdateWeather(MCONTACT hContact) DBEVENTINFO dbei = {}; dbei.szModule = MODULENAME; - dbei.timestamp = (DWORD)time(0); + dbei.timestamp = (uint32_t)time(0); dbei.flags = DBEF_READ | DBEF_UTF; dbei.eventType = EVENTTYPE_MESSAGE; dbei.pBlob = szMessage; - dbei.cbBlob = (DWORD)mir_strlen(szMessage) + 1; + dbei.cbBlob = (uint32_t)mir_strlen(szMessage) + 1; db_event_add(hContact, &dbei); } @@ -554,7 +554,7 @@ int GetWeatherData(MCONTACT hContact) if (cbuf[0] == '#') cbuf = TranslateW(DataValue); db_set_ws(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), cbuf); - CharLowerBuff(DataValue, (DWORD)mir_wstrlen(DataValue)); + CharLowerBuff(DataValue, (uint32_t)mir_wstrlen(DataValue)); cond = GetIcon(DataValue, Data); } else if (mir_wstrcmpi(Item->Item.Unit, L"Cond") == 0) { diff --git a/protocols/WebView/src/webview.cpp b/protocols/WebView/src/webview.cpp index 58b8e780b0..2f5b1d7780 100644 --- a/protocols/WebView/src/webview.cpp +++ b/protocols/WebView/src/webview.cpp @@ -26,7 +26,7 @@ char* WndClass = "WEBWnd"; WNDCLASSEX wincl; MSG messages; -DWORD winheight; +uint32_t winheight; int StartUpDelay = 0; int Xposition, Yposition; @@ -218,9 +218,9 @@ int Doubleclick(WPARAM wParam, LPARAM) int SendToRichEdit(HWND hWindow, char *truncated, COLORREF rgbText, COLORREF rgbBack) { DBVARIANT dbv; - DWORD bold = 0; - DWORD italic = 0; - DWORD underline = 0; + uint32_t bold = 0; + uint32_t italic = 0; + uint32_t underline = 0; SetDlgItemText(hWindow, IDC_DATA, L""); @@ -277,7 +277,7 @@ void CALLBACK timerfunc(HWND, UINT, UINT_PTR, DWORD) ///////////////////////////////////////////////////////////////////////////////////////// void CALLBACK Countdownfunc(HWND, UINT, UINT_PTR, DWORD) { - DWORD timetemp = g_plugin.getDword(COUNTDOWN_KEY, 100); + uint32_t timetemp = g_plugin.getDword(COUNTDOWN_KEY, 100); if (timetemp <= 0) { timetemp = g_plugin.getDword(REFRESH_KEY, TIME); g_plugin.setDword(COUNTDOWN_KEY, timetemp); diff --git a/protocols/WebView/src/webview_getdata.cpp b/protocols/WebView/src/webview_getdata.cpp index ab21c3f3ce..ae29e134ef 100644 --- a/protocols/WebView/src/webview_getdata.cpp +++ b/protocols/WebView/src/webview_getdata.cpp @@ -481,8 +481,8 @@ LBL_Stop: wchar_t *statusText = TranslateT("Processing data stopped by user.") SendDlgItemMessage(hwndDlg, IDC_DATA, EM_EXSETSEL, 0, (LPARAM)&sel2); SetFocus(GetDlgItem(hwndDlg, IDC_DATA)); - DWORD HiBackgoundClr = g_plugin.getDword(BG_COLOR_KEY, Def_color_bg); - DWORD HiTextClr = g_plugin.getDword(TXT_COLOR_KEY, Def_color_txt); + uint32_t HiBackgoundClr = g_plugin.getDword(BG_COLOR_KEY, Def_color_bg); + uint32_t HiTextClr = g_plugin.getDword(TXT_COLOR_KEY, Def_color_txt); CHARFORMAT2 Format; memset(&Format, 0, sizeof(Format)); diff --git a/protocols/WebView/src/webview_opts.cpp b/protocols/WebView/src/webview_opts.cpp index 923b45142c..941076168f 100644 --- a/protocols/WebView/src/webview_opts.cpp +++ b/protocols/WebView/src/webview_opts.cpp @@ -45,9 +45,9 @@ static int CALLBACK EnumFontScriptsProc(ENUMLOGFONTEX * lpelfe, NEWTEXTMETRICEX* static INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) { char str[512]; - DWORD BGColour = 0; - DWORD TextColour = 0; - DWORD delay = 0; + uint32_t BGColour = 0; + uint32_t TextColour = 0; + uint32_t delay = 0; static int test = 0; switch (msg) { @@ -208,7 +208,7 @@ static INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM static INT_PTR CALLBACK DlgProcOpt(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - DWORD timerval, delaytime, oldcolor; + uint32_t timerval, delaytime, oldcolor; DBVARIANT dbv; static int test = 0; static int test2 = 0; 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)) |