From fcbb395dc7ff3edab972b6d4b27dbbfb3305f5d7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Dec 2021 15:58:40 +0300 Subject: PBYTE -> uint8_t* --- plugins/AssocMgr/src/reg.cpp | 2 +- plugins/BasicHistory/src/DatExport.cpp | 2 +- plugins/BasicHistory/src/EventList.cpp | 4 +- plugins/BasicHistory/src/Scheduler.cpp | 2 +- plugins/BuddyPounce/src/main.cpp | 2 +- .../ChangeKeyboardLayout/src/text_operations.cpp | 4 +- plugins/Clist_nicer/src/clcpaint.cpp | 2 +- plugins/CmdLine/src/mimcmd_handlers.cpp | 4 +- plugins/CmdLine/src/utils.cpp | 2 +- plugins/CmdLine/src/utils.h | 4 +- plugins/ContactsPlus/src/send.cpp | 2 +- plugins/CrashDumper/src/upload.cpp | 2 +- plugins/CryptoPP/src/commonheaders.h | 2 +- plugins/CryptoPP/src/cpp_cntx.cpp | 8 ++-- plugins/CryptoPP/src/cpp_gpgw.cpp | 4 +- plugins/CryptoPP/src/cpp_gzip.cpp | 10 ++--- plugins/CryptoPP/src/cpp_keys.cpp | 14 +++--- plugins/CryptoPP/src/cpp_misc.cpp | 4 +- plugins/CryptoPP/src/cpp_pgpw.cpp | 8 ++-- plugins/CryptoPP/src/cpp_rsam.cpp | 52 +++++++++++----------- plugins/CryptoPP/src/cpp_rsam.h | 12 ++--- plugins/CryptoPP/src/cpp_rsau.cpp | 18 ++++---- plugins/CryptoPP/src/cpp_rsau.h | 6 +-- plugins/CryptoPP/src/cpp_svcs.cpp | 8 ++-- plugins/CryptoPP/src/cryptopp.h | 48 ++++++++++---------- plugins/CryptoPP/src/main.cpp | 2 +- plugins/Db3x_mmap/src/dbcache.cpp | 6 +-- plugins/Db3x_mmap/src/dbcontacts.cpp | 12 ++--- plugins/Db3x_mmap/src/dbcrypt.cpp | 8 ++-- plugins/Db3x_mmap/src/dbevents.cpp | 2 +- plugins/Db3x_mmap/src/dbintf.h | 32 ++++++------- plugins/Db3x_mmap/src/dbsettings.cpp | 16 +++---- plugins/DbChecker/src/worker.cpp | 2 +- plugins/Dbx_mdbx/src/dbevents.cpp | 2 +- plugins/Dbx_sqlite/src/dbevents.cpp | 2 +- plugins/Exchange/src/utils.cpp | 2 +- plugins/Exchange/src/utils.h | 4 +- plugins/FTPFileYM/src/job_upload.cpp | 2 +- plugins/HistoryStats/src/mirandacontact.cpp | 2 +- plugins/IEHistory/src/dlgHandlers.cpp | 12 ++--- plugins/IEHistory/src/utils.cpp | 2 +- plugins/Import/src/dbrw/dbevents.cpp | 2 +- plugins/Import/src/import.cpp | 4 +- plugins/Import/src/patterns.cpp | 2 +- plugins/Import/src/textjson.cpp | 4 +- plugins/MirFox/src/MirandaUtils.cpp | 2 +- plugins/MirLua/src/Modules/m_message.cpp | 2 +- plugins/MirOTR/src/dbfilter.cpp | 2 +- plugins/MirandaG15/src/CAppletManager.cpp | 2 +- .../MirandaG15/src/LCDFramework/CLCDConnection.cpp | 2 +- .../MirandaG15/src/LCDFramework/CLCDConnection.h | 2 +- .../src/LCDFramework/CLCDConnectionLogitech.cpp | 6 +-- .../src/LCDFramework/CLCDConnectionLogitech.h | 4 +- plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp | 8 ++-- plugins/MirandaG15/src/LCDFramework/CLCDGfx.h | 6 +-- plugins/MsgPopup/src/main.cpp | 4 +- plugins/NewAwaySysMod/src/MsgEventAdded.cpp | 2 +- plugins/NewXstatusNotify/src/main.cpp | 4 +- plugins/NewXstatusNotify/src/xstatus.cpp | 2 +- plugins/New_GPG/src/messages.cpp | 2 +- plugins/New_GPG/src/utilities.cpp | 2 +- plugins/Nudge/src/main.cpp | 4 +- plugins/PasteIt/src/PasteIt.cpp | 2 +- plugins/PluginUpdater/src/checksum.cpp | 32 ++++++------- plugins/Popup/src/popup_wnd2.cpp | 2 +- plugins/Scriver/src/globals.cpp | 2 +- plugins/Scriver/src/msglog.cpp | 2 +- plugins/SecureIM/src/crypt_dll.cpp | 2 +- plugins/SecureIM/src/cryptopp.h | 14 +++--- plugins/SecureIM/src/dbevent.cpp | 2 +- plugins/SecureIM/src/main.cpp | 2 +- plugins/SecureIM/src/mmi.cpp | 2 +- plugins/SecureIM/src/mmi.h | 2 +- plugins/SecureIM/src/options.cpp | 8 ++-- plugins/SecureIM/src/svcs_rsa.cpp | 8 ++-- plugins/SecureIM/src/svcs_rsa.h | 6 +-- plugins/SendScreenshotPlus/src/CSend.cpp | 2 +- plugins/ShellExt/src/main.cpp | 4 +- plugins/ShellExt/src/shlext.cpp | 2 +- plugins/ShellExt/src/shlicons.cpp | 2 +- plugins/SimpleAR/src/Main.cpp | 2 +- plugins/Spamotron/src/spamotron.cpp | 8 ++-- plugins/Spamotron/src/utils.cpp | 6 +-- plugins/StopSpamMod/src/utilities.cpp | 2 +- plugins/TabSRMM/src/globals.cpp | 2 +- plugins/TabSRMM/src/sendlater.cpp | 6 +-- plugins/TabSRMM/src/sendqueue.cpp | 4 +- .../src/ex_import/classExImContactBase.h | 2 +- .../src/ex_import/classExImContactXML.cpp | 6 +-- .../src/ex_import/dlg_ExImOpenSaveFile.cpp | 10 ++--- plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp | 4 +- plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp | 16 +++---- plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h | 4 +- plugins/UserInfoEx/src/mir_db.cpp | 2 +- plugins/UserInfoEx/src/svc_refreshci.cpp | 12 ++--- plugins/Variables/src/parse_system.cpp | 6 +-- plugins/WhenWasIt/src/utils.cpp | 2 +- plugins/WhenWasIt/src/utils.h | 4 +- plugins/YARelay/src/main.cpp | 2 +- protocols/CloudFile/src/utils.cpp | 4 +- .../src/CurrencyRatesProviderBase.cpp | 2 +- protocols/CurrencyRates/src/ImportExport.cpp | 2 +- protocols/Discord/src/server.cpp | 2 +- protocols/EmLanProto/src/mlan.cpp | 4 +- protocols/Gadu-Gadu/src/core.cpp | 2 +- protocols/GmailNotifier/src/notify.cpp | 2 +- protocols/ICQCorp/src/services.cpp | 4 +- protocols/IRCG/src/commandmonitor.cpp | 2 +- protocols/NewsAggregator/Src/CheckFeed.cpp | 2 +- protocols/SkypeWeb/src/requests/avatars.h | 2 +- protocols/SkypeWeb/src/requests/files.h | 2 +- protocols/SkypeWeb/src/skype_avatars.cpp | 2 +- protocols/SkypeWeb/src/skype_contacts.cpp | 2 +- protocols/SkypeWeb/src/skype_db.cpp | 2 +- protocols/SkypeWeb/src/skype_messages.cpp | 4 +- protocols/SkypeWeb/src/skype_proto.cpp | 2 +- protocols/Steam/src/steam_contacts.cpp | 2 +- protocols/Tox/src/tox_contacts.cpp | 2 +- protocols/Tox/src/tox_messages.cpp | 2 +- protocols/Tox/src/tox_proto.h | 2 +- protocols/Tox/src/tox_utils.cpp | 2 +- protocols/Twitter/src/oauth.cpp | 2 +- protocols/VKontakte/src/misc.cpp | 4 +- src/core/stdclist/src/clcpaint.cpp | 2 +- src/core/stdfile/src/file.cpp | 4 +- src/core/stdfile/src/fileexistsdlg.cpp | 2 +- src/core/stdfile/src/filexferdlg.cpp | 2 +- src/core/stdmsg/src/cmdlist.cpp | 2 +- src/core/stdmsg/src/msglog.cpp | 2 +- src/core/stduihist/src/history.cpp | 2 +- src/mir_app/src/chat_log.cpp | 2 +- src/mir_app/src/chat_manager.cpp | 6 +-- src/mir_app/src/db_events.cpp | 4 +- src/mir_app/src/db_ini.cpp | 2 +- src/mir_app/src/dll_sniffer.cpp | 18 ++++---- src/mir_app/src/netlib.h | 2 +- src/mir_app/src/netlib_http.cpp | 2 +- src/mir_app/src/netlib_openconn.cpp | 4 +- src/mir_app/src/netlib_opts.cpp | 8 ++-- src/mir_app/src/netlib_pktrecver.cpp | 2 +- src/mir_app/src/netlib_sock.cpp | 4 +- src/mir_app/src/proto_interface.cpp | 2 +- src/mir_app/src/protocols.cpp | 2 +- 143 files changed, 365 insertions(+), 365 deletions(-) diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp index fda90a497c..6adb696026 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -354,7 +354,7 @@ static BOOL IsRegStrValueA(HKEY hKey, const wchar_t *pszValName, const char *psz static void WriteDbBackupData(const char *pszSetting, DWORD dwType, BYTE *pData, DWORD cbData) { size_t cbLen = cbData + sizeof(DWORD); - PBYTE buf = (PBYTE)mir_alloc(cbLen); + uint8_t *buf = (uint8_t*)mir_alloc(cbLen); if (buf) { *(DWORD*)buf = dwType; memcpy(buf + sizeof(DWORD), pData, cbData); diff --git a/plugins/BasicHistory/src/DatExport.cpp b/plugins/BasicHistory/src/DatExport.cpp index c6a020fb05..3b1fa0f8cb 100644 --- a/plugins/BasicHistory/src/DatExport.cpp +++ b/plugins/BasicHistory/src/DatExport.cpp @@ -181,7 +181,7 @@ bool DatExport::GetEventList(std::vector& eventList) info.flags = messageHeader.flags; info.timestamp = messageHeader.timestamp; info.cbBlob = messageHeader.cbBlob; - info.pBlob = (PBYTE)memBuf.c_str(); + info.pBlob = (uint8_t*)memBuf.c_str(); HistoryEventList::GetObjectDescription(&info, _str, MAXSELECTSTR); exMsg.message = _str; sortedEvents.insert(std::pair(messageHeader.timestamp, exMsg)); diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index b686dbc998..39ff4ff4ca 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -508,7 +508,7 @@ void HistoryEventList::MargeMessages(const std::vector dbei.cbBlob = WideCharToMultiByte(cp, 0, msg.message.c_str(), (int)msg.message.length() + 1, nullptr, 0, nullptr, nullptr); char* buf = new char[dbei.cbBlob]; dbei.cbBlob = WideCharToMultiByte(cp, 0, msg.message.c_str(), (int)msg.message.length() + 1, buf, dbei.cbBlob, nullptr, nullptr); - dbei.pBlob = (PBYTE)buf; + dbei.pBlob = (uint8_t*)buf; db_event_add(m_hContact, &dbei); delete[] buf; } @@ -524,7 +524,7 @@ bool HistoryEventList::GetEventData(const EventIndex& ev, EventData& data) if (!ev.isExternal) { DWORD newBlobSize = db_event_getBlobSize(ev.hEvent); if (newBlobSize > m_oldBlobSize) { - m_dbei.pBlob = (PBYTE)mir_realloc(m_dbei.pBlob, newBlobSize); + m_dbei.pBlob = (uint8_t*)mir_realloc(m_dbei.pBlob, newBlobSize); m_oldBlobSize = newBlobSize; } diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp index 51cce458ec..ad53e27731 100644 --- a/plugins/BasicHistory/src/Scheduler.cpp +++ b/plugins/BasicHistory/src/Scheduler.cpp @@ -1285,7 +1285,7 @@ void DoError(const TaskOptions& to, const std::wstring _error) dbei.cbBlob = WideCharToMultiByte(CP_UTF8, 0, error.c_str(), len, nullptr, 0, nullptr, nullptr); char* buf = new char[dbei.cbBlob]; dbei.cbBlob = WideCharToMultiByte(CP_UTF8, 0, error.c_str(), len, buf, dbei.cbBlob, nullptr, nullptr); - dbei.pBlob = (PBYTE)buf; + dbei.pBlob = (uint8_t*)buf; db_event_add(NULL, &dbei); } diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index d467353a70..0562776660 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -51,7 +51,7 @@ int MsgAck(WPARAM, LPARAM lParam) dbei.szModule = (char*)ack->szModule; dbei.timestamp = time(0); dbei.cbBlob = (int)mir_strlen(pszUtf) + 1; - dbei.pBlob = (PBYTE)(char*)pszUtf; + dbei.pBlob = (uint8_t*)(char*)pszUtf; db_event_add(ack->hContact, &dbei); } // check to reuse diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp index 73bfd79160..06e7a8f3ea 100644 --- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp +++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp @@ -5,7 +5,7 @@ struct EditStreamData EditStreamData() { pbBuff = nullptr; cbBuff = iCurrent = 0; } ~EditStreamData() { free(pbBuff); } - PBYTE pbBuff; + uint8_t* pbBuff; int cbBuff; int iCurrent; }; @@ -14,7 +14,7 @@ static DWORD CALLBACK EditStreamOutRtf(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG c { EditStreamData *esd = (EditStreamData *)dwCookie; esd->cbBuff += cb; - esd->pbBuff = (PBYTE)realloc(esd->pbBuff, esd->cbBuff + sizeof(wchar_t)); + esd->pbBuff = (uint8_t*)realloc(esd->pbBuff, esd->cbBuff + sizeof(wchar_t)); memcpy(esd->pbBuff + esd->iCurrent, pbBuff, cb); esd->iCurrent += cb; esd->pbBuff[esd->iCurrent] = 0; diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp index 8337f4afe0..de22664a9b 100644 --- a/plugins/Clist_nicer/src/clcpaint.cpp +++ b/plugins/Clist_nicer/src/clcpaint.cpp @@ -1458,7 +1458,7 @@ bgdone: bmih.biPlanes = 1; bmih.biWidth = clRect.right; - PBYTE bits = (PBYTE)mir_alloc(4 * bmih.biWidth * -bmih.biHeight); + uint8_t *bits = (uint8_t*)mir_alloc(4 * bmih.biWidth * -bmih.biHeight); GetDIBits(hdc, hBmpOsb, 0, clRect.bottom, bits, (BITMAPINFO *)&bmih, DIB_RGB_COLORS); COLORREF greyColour = GetSysColor(COLOR_3DFACE); diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index d46e7b55b1..ac0342869c 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -705,7 +705,7 @@ void HandleMessageCommand(PCommand command, TArgument *argv, int argc, PReply re DBEVENTINFO dbei = {}; dbei.eventType = EVENTTYPE_MESSAGE; dbei.flags = DBEF_SENT | DBEF_UTF; - dbei.pBlob = (PBYTE)szMessage.get(); + dbei.pBlob = (uint8_t*)szMessage.get(); dbei.cbBlob = (DWORD)mir_strlen(szMessage) + 1; dbei.szModule = ack->szModule; dbei.timestamp = (DWORD)time(0); @@ -1346,7 +1346,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re DBEVENTINFO dbEvent = {}; char message[4096]; - dbEvent.pBlob = (PBYTE)message; + dbEvent.pBlob = (uint8_t*)message; DB::ECPTR pCursor(DB::Events(hContact)); while (MEVENT hEvent = pCursor.FetchNext()) { diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp index 9dba308c9b..88952e7ed2 100644 --- a/plugins/CmdLine/src/utils.cpp +++ b/plugins/CmdLine/src/utils.cpp @@ -36,7 +36,7 @@ int Info(char *title, char *format, ...) #define HEX_SIZE 8 -char *BinToHex(int size, PBYTE data) +char *BinToHex(int size, uint8_t *data) { char *szresult = nullptr; int maxSize = size * 2 + HEX_SIZE + 1; diff --git a/plugins/CmdLine/src/utils.h b/plugins/CmdLine/src/utils.h index 8b7b1258c7..75572a5c7e 100644 --- a/plugins/CmdLine/src/utils.h +++ b/plugins/CmdLine/src/utils.h @@ -31,8 +31,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. int Info(char *title, char *format, ...); -char *BinToHex(int size, PBYTE data); -void HexToBin(char *inData, ULONG &size, PBYTE &outData); +char *BinToHex(int size, uint8_t *data); +void HexToBin(char *inData, ULONG &size, uint8_t* &outData); void ScreenToClient(HWND hWnd, LPRECT rect); void AnchorMoveWindow(HWND window, const WINDOWPOS *parentPos, int anchors); diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index f53fbfe44a..15b1ae1522 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -412,7 +412,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara maSend[i].mcaUIN = mir_utf8encodeW(ptrW(GetContactUID(ackData->aContacts[i]))); dbei.cbBlob += (DWORD)strlennull(maSend[i].mcaUIN) + (DWORD)strlennull((char*)maSend[i].mcaNick) + 2; } - dbei.pBlob = (PBYTE)_alloca(dbei.cbBlob); + dbei.pBlob = (uint8_t*)_alloca(dbei.cbBlob); for (i = 0, pBlob = (char*)dbei.pBlob; i < ackData->nContacts; i++) { strcpynull(pBlob, (char*)maSend[i].mcaNick); pBlob += strlennull(pBlob) + 1; diff --git a/plugins/CrashDumper/src/upload.cpp b/plugins/CrashDumper/src/upload.cpp index 702bc39e96..099dc5f694 100644 --- a/plugins/CrashDumper/src/upload.cpp +++ b/plugins/CrashDumper/src/upload.cpp @@ -228,7 +228,7 @@ bool ProcessVIHash(bool store) mir_md5_state_t context; mir_md5_init(&context); - mir_md5_append(&context, (PBYTE)buffer.c_str(), buffer.GetLength()*sizeof(wchar_t)); + mir_md5_append(&context, (uint8_t*)buffer.c_str(), buffer.GetLength()*sizeof(wchar_t)); mir_md5_finish(&context, hash); char hashstr[40]; diff --git a/plugins/CryptoPP/src/commonheaders.h b/plugins/CryptoPP/src/commonheaders.h index 575fa7a96a..9fb22609c5 100644 --- a/plugins/CryptoPP/src/commonheaders.h +++ b/plugins/CryptoPP/src/commonheaders.h @@ -86,7 +86,7 @@ int Sent_NetLog(const char *, ...); #define DLLEXPORT __declspec(dllexport) -PBYTE cpp_alloc_pdata(pCNTX); +uint8_t* cpp_alloc_pdata(pCNTX); extern "C" { diff --git a/plugins/CryptoPP/src/cpp_cntx.cpp b/plugins/CryptoPP/src/cpp_cntx.cpp index 9fcb9e8542..feab8a48e9 100644 --- a/plugins/CryptoPP/src/cpp_cntx.cpp +++ b/plugins/CryptoPP/src/cpp_cntx.cpp @@ -45,22 +45,22 @@ void __cdecl cpp_reset_context(HANDLE context) } // allocate pdata -PBYTE cpp_alloc_pdata(pCNTX ptr) +uint8_t* cpp_alloc_pdata(pCNTX ptr) { if (!ptr->pdata) { if (ptr->mode & MODE_PGP) { - ptr->pdata = (PBYTE)malloc(sizeof(PGPDATA)); + ptr->pdata = (uint8_t*)malloc(sizeof(PGPDATA)); memset(ptr->pdata, 0, sizeof(PGPDATA)); } else if (ptr->mode & MODE_GPG) { - ptr->pdata = (PBYTE)malloc(sizeof(GPGDATA)); + ptr->pdata = (uint8_t*)malloc(sizeof(GPGDATA)); memset(ptr->pdata, 0, sizeof(GPGDATA)); } else if (ptr->mode & MODE_RSA) { rsa_alloc(ptr); } else { - ptr->pdata = (PBYTE)malloc(sizeof(SIMDATA)); + ptr->pdata = (uint8_t*)malloc(sizeof(SIMDATA)); memset(ptr->pdata, 0, sizeof(SIMDATA)); } } diff --git a/plugins/CryptoPP/src/cpp_gpgw.cpp b/plugins/CryptoPP/src/cpp_gpgw.cpp index 6141ee8796..224ddf82d4 100644 --- a/plugins/CryptoPP/src/cpp_gpgw.cpp +++ b/plugins/CryptoPP/src/cpp_gpgw.cpp @@ -3,7 +3,7 @@ HMODULE hgpg; HRSRC hRS_gpg; -PBYTE pRS_gpg; +uint8_t *pRS_gpg; int __cdecl _gpg_init(void); int __cdecl _gpg_done(void); @@ -163,7 +163,7 @@ int __cdecl gpg_set_keyid(HANDLE context, LPCSTR RemoteKeyID) ptr->error = ERROR_NONE; SAFE_FREE(p->gpgKeyID); - p->gpgKeyID = (PBYTE)_strdup(RemoteKeyID); + p->gpgKeyID = (uint8_t*)_strdup(RemoteKeyID); return 1; } diff --git a/plugins/CryptoPP/src/cpp_gzip.cpp b/plugins/CryptoPP/src/cpp_gzip.cpp index 41183d3eb5..1750a255a4 100644 --- a/plugins/CryptoPP/src/cpp_gzip.cpp +++ b/plugins/CryptoPP/src/cpp_gzip.cpp @@ -9,7 +9,7 @@ BYTE *cpp_gzip(BYTE *pData, size_t nLen, size_t& nCompressedLen) gzip.MessageEnd(); nCompressedLen = (int)zipped.length(); - PBYTE pCompressed = (PBYTE)malloc(nCompressedLen + 1); + uint8_t *pCompressed = (uint8_t*)malloc(nCompressedLen + 1); memcpy(pCompressed, zipped.data(), nCompressedLen); return pCompressed; @@ -20,11 +20,11 @@ BYTE *cpp_gunzip(BYTE *pCompressedData, size_t nCompressedLen, size_t& nLen) { string unzipped; Gunzip gunzip(new StringSink(unzipped)); - gunzip.Put((PBYTE)pCompressedData, nCompressedLen); + gunzip.Put((uint8_t*)pCompressedData, nCompressedLen); gunzip.MessageEnd(); nLen = (int)unzipped.length(); - PBYTE pData = (PBYTE)malloc(nLen + 1); + uint8_t *pData = (uint8_t*)malloc(nLen + 1); memcpy(pData, unzipped.data(), nLen); return pData; @@ -35,7 +35,7 @@ string cpp_zlibc(string& pData) { string zipped; ZlibCompressor zlib(new StringSink(zipped), 5); // 1 is fast, 9 is slow - zlib.Put((PBYTE)pData.data(), pData.length()); + zlib.Put((uint8_t*)pData.data(), pData.length()); zlib.MessageEnd(); return zipped; @@ -46,7 +46,7 @@ string cpp_zlibd(string& pData) { string unzipped; ZlibDecompressor zlib(new StringSink(unzipped)); - zlib.Put((PBYTE)pData.data(), pData.length()); + zlib.Put((uint8_t*)pData.data(), pData.length()); zlib.MessageEnd(); return unzipped; diff --git a/plugins/CryptoPP/src/cpp_keys.cpp b/plugins/CryptoPP/src/cpp_keys.cpp index ffcf0645a0..38c82bf6b8 100644 --- a/plugins/CryptoPP/src/cpp_keys.cpp +++ b/plugins/CryptoPP/src/cpp_keys.cpp @@ -34,11 +34,11 @@ LPSTR __cdecl cpp_init_keya(HANDLE context, int features) p->dh->GenerateKeyPair(autorng, priv1, publ1); SAFE_FREE(p->PubA); - p->PubA = (PBYTE)malloc(KEYSIZE); + p->PubA = (uint8_t*)malloc(KEYSIZE); memcpy(p->PubA, publ1, KEYSIZE); SAFE_FREE(p->KeyA); - p->KeyA = (PBYTE)malloc(KEYSIZE); + p->KeyA = (uint8_t*)malloc(KEYSIZE); memcpy(p->KeyA, priv1, KEYSIZE); if (p->KeyP) { @@ -110,7 +110,7 @@ int __cdecl cpp_init_keyb(HANDLE context, LPCSTR key) CFB_Mode::Decryption dec(p->KeyP, Tiger::DIGESTSIZE, IV); StreamTransformationFilter cbcDecryptor(dec, new StringSink(unciphered)); - cbcDecryptor.Put((PBYTE)pub_binary, KEYSIZE); + cbcDecryptor.Put((uint8_t*)pub_binary, KEYSIZE); cbcDecryptor.MessageEnd(); memcpy(pub_binary, unciphered.data(), unciphered.length()); } @@ -123,7 +123,7 @@ int __cdecl cpp_init_keyb(HANDLE context, LPCSTR key) } mir_free(p->KeyB); - p->KeyB = (PBYTE)pub_binary; + p->KeyB = (uint8_t*)pub_binary; if (p->PubA && memcmp(p->PubA, p->KeyB, KEYSIZE) == 0) { #if defined(_DEBUG) || defined(NETLIB_LOG) @@ -167,7 +167,7 @@ int __cdecl cpp_calc_keyx(HANDLE context) // store key SAFE_FREE(p->KeyX); - p->KeyX = (PBYTE)malloc(Tiger::DIGESTSIZE); + p->KeyX = (uint8_t*)malloc(Tiger::DIGESTSIZE); memcpy(p->KeyX, buffer, Tiger::DIGESTSIZE); } return (int)agr; @@ -183,11 +183,11 @@ int __cdecl cpp_init_keyp(HANDLE context, LPCSTR password) memset(buffer, 0, sizeof(buffer)); // calculate hash - Tiger().CalculateDigest(buffer, (PBYTE)password, strlen(password)); + Tiger().CalculateDigest(buffer, (uint8_t*)password, strlen(password)); // store pre-shared key SAFE_FREE(p->KeyP); - p->KeyP = (PBYTE)malloc(Tiger::DIGESTSIZE); + p->KeyP = (uint8_t*)malloc(Tiger::DIGESTSIZE); memcpy(p->KeyP, buffer, Tiger::DIGESTSIZE); return 1; diff --git a/plugins/CryptoPP/src/cpp_misc.cpp b/plugins/CryptoPP/src/cpp_misc.cpp index bdd3f2a645..0b05a59356 100644 --- a/plugins/CryptoPP/src/cpp_misc.cpp +++ b/plugins/CryptoPP/src/cpp_misc.cpp @@ -56,7 +56,7 @@ void __cdecl cpp_set_keyx(HANDLE context, BYTE *key) SAFE_FREE(p->KeyA); mir_free(p->KeyB); p->KeyB = nullptr; SAFE_FREE(p->KeyX); - p->KeyX = (PBYTE)malloc(Tiger::DIGESTSIZE + 2); + p->KeyX = (uint8_t*)malloc(Tiger::DIGESTSIZE + 2); memcpy(p->KeyX, key, Tiger::DIGESTSIZE); memcpy(&ptr->features, key + Tiger::DIGESTSIZE, 2); } @@ -82,7 +82,7 @@ void __cdecl cpp_set_keyp(HANDLE context, BYTE *key) if (!cpp_get_simdata(context, &ptr, &p)) return; SAFE_FREE(p->KeyP); - p->KeyP = (PBYTE)malloc(Tiger::DIGESTSIZE); + p->KeyP = (uint8_t*)malloc(Tiger::DIGESTSIZE); memcpy(p->KeyP, key, Tiger::DIGESTSIZE); } diff --git a/plugins/CryptoPP/src/cpp_pgpw.cpp b/plugins/CryptoPP/src/cpp_pgpw.cpp index 4c148cffec..9e2316a0e4 100644 --- a/plugins/CryptoPP/src/cpp_pgpw.cpp +++ b/plugins/CryptoPP/src/cpp_pgpw.cpp @@ -4,7 +4,7 @@ HMODULE hpgpsdk; UINT pgpVer; HRSRC hRS_pgp; -PBYTE pRS_pgp; +uint8_t *pRS_pgp; int __cdecl _pgp_init(void); int __cdecl _pgp_done(void); @@ -93,7 +93,7 @@ int __cdecl pgp_init() // create context for private pgp keys hPGPPRIV = (HANDLE)cpp_create_context(MODE_PGP | MODE_PRIV_KEY); pCNTX tmp = (pCNTX)hPGPPRIV; - tmp->pdata = (PBYTE)malloc(sizeof(PGPDATA)); + tmp->pdata = (uint8_t*)malloc(sizeof(PGPDATA)); memset(tmp->pdata, 0, sizeof(PGPDATA)); } @@ -221,7 +221,7 @@ int __cdecl pgp_set_key(HANDLE context, LPCSTR RemoteKey) ptr->error = ERROR_NONE; SAFE_FREE(p->pgpKey); - p->pgpKey = (PBYTE)_strdup(RemoteKey); + p->pgpKey = (uint8_t*)_strdup(RemoteKey); return 1; } @@ -235,7 +235,7 @@ int __cdecl pgp_set_keyid(HANDLE context, PVOID RemoteKeyID) ptr->error = ERROR_NONE; SAFE_FREE(p->pgpKeyID); - p->pgpKeyID = (PBYTE)malloc(p_pgp_size_keyid()); + p->pgpKeyID = (uint8_t*)malloc(p_pgp_size_keyid()); memcpy(p->pgpKeyID, RemoteKeyID, p_pgp_size_keyid()); return 1; diff --git a/plugins/CryptoPP/src/cpp_rsam.cpp b/plugins/CryptoPP/src/cpp_rsam.cpp index 1ff82b508d..8ef706ff98 100644 --- a/plugins/CryptoPP/src/cpp_rsam.cpp +++ b/plugins/CryptoPP/src/cpp_rsam.cpp @@ -58,7 +58,7 @@ int __cdecl rsa_init(pRSA_EXPORT* e, pRSA_IMPORT i) hRSA4096 = (HANDLE)cpp_create_context(MODE_RSA_4096 | MODE_PRIV_KEY); pCNTX tmp = (pCNTX)hRSA4096; pRSAPRIV p = new RSAPRIV; - tmp->pdata = (PBYTE)p; + tmp->pdata = (uint8_t*)p; } return 1; } @@ -131,7 +131,7 @@ int __cdecl rsa_gen_keypair(short mode) return 1; } -int __cdecl rsa_get_keypair(short mode, PBYTE privKey, int* privKeyLen, PBYTE pubKey, int* pubKeyLen) +int __cdecl rsa_get_keypair(short mode, uint8_t *privKey, int *privKeyLen, uint8_t *pubKey, int *pubKeyLen) { #if defined(_DEBUG) || defined(NETLIB_LOG) Sent_NetLog("rsa_get_keypair: %d", mode); @@ -144,7 +144,7 @@ int __cdecl rsa_get_keypair(short mode, PBYTE privKey, int* privKeyLen, PBYTE pu return 1; } -int __cdecl rsa_get_keyhash(short mode, PBYTE privKey, int* privKeyLen, PBYTE pubKey, int* pubKeyLen) +int __cdecl rsa_get_keyhash(short mode, uint8_t *privKey, int *privKeyLen, uint8_t *pubKey, int *pubKeyLen) { #if defined(_DEBUG) || defined(NETLIB_LOG) Sent_NetLog("rsa_get_keyhash: %d", mode); @@ -158,7 +158,7 @@ int __cdecl rsa_get_keyhash(short mode, PBYTE privKey, int* privKeyLen, PBYTE pu return 1; } -int __cdecl rsa_set_keypair(short mode, PBYTE privKey, int privKeyLen) +int __cdecl rsa_set_keypair(short mode, uint8_t *privKey, int privKeyLen) { #if defined(_DEBUG) || defined(NETLIB_LOG) Sent_NetLog("rsa_set_keypair: %s", privKey); @@ -193,7 +193,7 @@ int __cdecl rsa_set_keypair(short mode, PBYTE privKey, int privKeyLen) return 1; } -int __cdecl rsa_get_pubkey(HANDLE context, PBYTE pubKey, int* pubKeyLen) +int __cdecl rsa_get_pubkey(HANDLE context, uint8_t *pubKey, int *pubKeyLen) { #if defined(_DEBUG) || defined(NETLIB_LOG) Sent_NetLog("rsa_get_pubkey: %s", pubKey); @@ -206,7 +206,7 @@ int __cdecl rsa_get_pubkey(HANDLE context, PBYTE pubKey, int* pubKeyLen) return 1; } -int __cdecl rsa_set_pubkey(HANDLE context, PBYTE pubKey, int pubKeyLen) +int __cdecl rsa_set_pubkey(HANDLE context, uint8_t *pubKey, int pubKeyLen) { #if defined(_DEBUG) || defined(NETLIB_LOG) Sent_NetLog("rsa_set_pubkey: %s", pubKey); @@ -238,7 +238,7 @@ int __cdecl rsa_get_state(HANDLE context) return p->state; } -int __cdecl rsa_get_hash(PBYTE pubKey, int pubKeyLen, PBYTE pubHash, int* pubHashLen) +int __cdecl rsa_get_hash(uint8_t *pubKey, int pubKeyLen, uint8_t *pubHash, int *pubHashLen) { #if defined(_DEBUG) || defined(NETLIB_LOG) Sent_NetLog("rsa_get_hash: %d", pubKeyLen); @@ -286,7 +286,7 @@ int __cdecl rsa_disconnect(HANDLE context) pRSADATA p = (pRSADATA)cpp_alloc_pdata(ptr); if (!p->state) return 1; - PBYTE buffer = (PBYTE)alloca(RAND_SIZE); + uint8_t *buffer = (uint8_t*)alloca(RAND_SIZE); GlobalRNG().GenerateBlock(buffer, RAND_SIZE); inject_msg(context, 0xF0, encode_msg(0, p, ::hash(buffer, RAND_SIZE))); @@ -386,7 +386,7 @@ LPSTR __cdecl rsa_recv(HANDLE context, LPCSTR msg) return nullptr; } { - PBYTE buffer = (PBYTE)alloca(RAND_SIZE); + uint8_t *buffer = (uint8_t*)alloca(RAND_SIZE); GlobalRNG().GenerateBlock(buffer, RAND_SIZE); inject_msg(context, 0x60, encode_msg(0, p, ::hash(buffer, RAND_SIZE))); } @@ -491,9 +491,9 @@ string encode_msg(short z, pRSADATA p, string& msg) string ciphered; try { - CBC_Mode::Encryption enc((PBYTE)p->aes_k.data(), p->aes_k.length(), (PBYTE)p->aes_v.data()); + CBC_Mode::Encryption enc((uint8_t*)p->aes_k.data(), p->aes_k.length(), (uint8_t*)p->aes_v.data()); StreamTransformationFilter cbcEncryptor(enc, new StringSink(ciphered)); - cbcEncryptor.Put((PBYTE)zlib.data(), zlib.length()); + cbcEncryptor.Put((uint8_t*)zlib.data(), zlib.length()); cbcEncryptor.MessageEnd(); } catch (...) { @@ -513,9 +513,9 @@ string decode_msg(pRSADATA p, string& msg) string unciphered, zlib; try { - CBC_Mode::Decryption dec((PBYTE)p->aes_k.data(), p->aes_k.length(), (PBYTE)p->aes_v.data()); + CBC_Mode::Decryption dec((uint8_t*)p->aes_k.data(), p->aes_k.length(), (uint8_t*)p->aes_v.data()); StreamTransformationFilter cbcDecryptor(dec, new StringSink(zlib)); - cbcDecryptor.Put((PBYTE)ciphered.data(), ciphered.length()); + cbcDecryptor.Put((uint8_t*)ciphered.data(), ciphered.length()); cbcDecryptor.MessageEnd(); if (sig == ::hash(zlib)) @@ -563,7 +563,7 @@ string gen_aes_key_iv(short m, pRSADATA p, pRSAPRIV r) #if defined(_DEBUG) || defined(NETLIB_LOG) Sent_NetLog("gen_aes_key_iv: %04x", m); #endif - PBYTE buffer = (PBYTE)alloca(RAND_SIZE); + uint8_t *buffer = (uint8_t*)alloca(RAND_SIZE); GlobalRNG().GenerateBlock(buffer, RAND_SIZE); p->aes_k = hash256(buffer, RAND_SIZE); @@ -655,7 +655,7 @@ int __cdecl rsa_encrypt_file(HANDLE context, LPCSTR file_in, LPCSTR file_out) pRSADATA p = (pRSADATA)cpp_alloc_pdata(ptr); if (p->state != 7) return 0; try { - CBC_Mode::Encryption enc((PBYTE)p->aes_k.data(), p->aes_k.length(), (PBYTE)p->aes_v.data()); + CBC_Mode::Encryption enc((uint8_t*)p->aes_k.data(), p->aes_k.length(), (uint8_t*)p->aes_v.data()); FileSource *f = new FileSource(file_in, true, new StreamTransformationFilter(enc, new FileSink(file_out))); delete f; } @@ -672,7 +672,7 @@ int __cdecl rsa_decrypt_file(HANDLE context, LPCSTR file_in, LPCSTR file_out) pRSADATA p = (pRSADATA)cpp_alloc_pdata(ptr); if (p->state != 7) return 0; try { - CBC_Mode::Decryption dec((PBYTE)p->aes_k.data(), p->aes_k.length(), (PBYTE)p->aes_v.data()); + CBC_Mode::Decryption dec((uint8_t*)p->aes_k.data(), p->aes_k.length(), (uint8_t*)p->aes_v.data()); FileSource *f = new FileSource(file_in, true, new StreamTransformationFilter(dec, new FileSink(file_out))); delete f; } @@ -732,7 +732,7 @@ int __cdecl rsa_recv_thread(HANDLE context, string& msg) string pub; un_tlv(un_tlv(data, t[0], features), t[1], pub); string sig = ::hash(pub); - if (!imp->rsa_check_pub(context, (PBYTE)pub.data(), (int)pub.length(), (PBYTE)sig.data(), (int)sig.length())) { + if (!imp->rsa_check_pub(context, (uint8_t*)pub.data(), (int)pub.length(), (uint8_t*)sig.data(), (int)sig.length())) { p->state = 0; p->time = 0; null_msg(context, 0x00, -type); // сессия разорвана по ошибке return 0; @@ -758,7 +758,7 @@ int __cdecl rsa_recv_thread(HANDLE context, string& msg) string pub; un_tlv(un_tlv(data, t[0], features), t[1], pub); string sig = ::hash(pub); - if (!imp->rsa_check_pub(context, (PBYTE)pub.data(), (int)pub.length(), (PBYTE)sig.data(), (int)sig.length())) { + if (!imp->rsa_check_pub(context, (uint8_t*)pub.data(), (int)pub.length(), (uint8_t*)sig.data(), (int)sig.length())) { p->state = 0; p->time = 0; null_msg(context, 0x00, -type); // сессия разорвана по ошибке return 0; @@ -779,7 +779,7 @@ int __cdecl rsa_recv_thread(HANDLE context, string& msg) string pub; un_tlv(data, t[0], pub); string sig = ::hash(pub); - if (!imp->rsa_check_pub(context, (PBYTE)pub.data(), (int)pub.length(), (PBYTE)sig.data(), (int)sig.length())) { + if (!imp->rsa_check_pub(context, (uint8_t*)pub.data(), (int)pub.length(), (uint8_t*)sig.data(), (int)sig.length())) { p->state = 0; p->time = 0; null_msg(context, 0x00, -type); // сессия разорвана по ошибке return 0; @@ -806,7 +806,7 @@ int __cdecl rsa_recv_thread(HANDLE context, string& msg) } un_tlv(key, t[0], p->aes_k); un_tlv(key, t[1], p->aes_v); - PBYTE buffer = (PBYTE)alloca(RAND_SIZE); + uint8_t *buffer = (uint8_t*)alloca(RAND_SIZE); GlobalRNG().GenerateBlock(buffer, RAND_SIZE); inject_msg(context, 0x50, encode_msg(0, p, ::hash(buffer, RAND_SIZE))); p->state = 6; @@ -820,7 +820,7 @@ int __cdecl rsa_recv_thread(HANDLE context, string& msg) un_tlv(un_tlv(un_tlv(data, t[0], features), t[1], pub), t[2], sha); if (p->pub_k != pub) { // пришел новый паблик string sig = ::hash(pub); - if (!imp->rsa_check_pub(context, (PBYTE)pub.data(), (int)pub.length(), (PBYTE)sig.data(), (int)sig.length())) { + if (!imp->rsa_check_pub(context, (uint8_t*)pub.data(), (int)pub.length(), (uint8_t*)sig.data(), (int)sig.length())) { p->state = 0; p->time = 0; null_msg(context, 0x00, -type); // сессия разорвана по ошибке return 0; @@ -849,7 +849,7 @@ void rsa_alloc(pCNTX ptr) p->thread = p->event = nullptr; p->thread_exit = 0; p->queue = new STRINGQUEUE; - ptr->pdata = (PBYTE)p; + ptr->pdata = (uint8_t*)p; } int rsa_free(pCNTX ptr) @@ -957,9 +957,9 @@ int __cdecl rsa_export_keypair(short mode, LPSTR privKey, LPSTR pubKey, LPSTR pa string ciphered; try { - CBC_Mode::Encryption enc((PBYTE)key.data(), key.length(), (PBYTE)iv.data()); + CBC_Mode::Encryption enc((uint8_t*)key.data(), key.length(), (uint8_t*)iv.data()); StreamTransformationFilter cbcEncryptor(enc, new StringSink(ciphered)); - cbcEncryptor.Put((PBYTE)priv.data(), priv.length()); + cbcEncryptor.Put((uint8_t*)priv.data(), priv.length()); cbcEncryptor.MessageEnd(); } catch (...) { @@ -1008,9 +1008,9 @@ int __cdecl rsa_import_keypair(short mode, LPSTR privKey, LPSTR passPhrase) string unciphered; try { - CBC_Mode::Decryption dec((PBYTE)key.data(), key.length(), (PBYTE)iv.data()); + CBC_Mode::Decryption dec((uint8_t*)key.data(), key.length(), (uint8_t*)iv.data()); StreamTransformationFilter cbcDecryptor(dec, new StringSink(unciphered)); - cbcDecryptor.Put((PBYTE)priv.data(), priv.length()); + cbcDecryptor.Put((uint8_t*)priv.data(), priv.length()); cbcDecryptor.MessageEnd(); } catch (...) { diff --git a/plugins/CryptoPP/src/cpp_rsam.h b/plugins/CryptoPP/src/cpp_rsam.h index 7ffdbe1579..9bceaa8ed6 100644 --- a/plugins/CryptoPP/src/cpp_rsam.h +++ b/plugins/CryptoPP/src/cpp_rsam.h @@ -2,14 +2,14 @@ #define __CPP_RSAM_H__ int __cdecl rsa_gen_keypair(short); -int __cdecl rsa_get_keypair(short,PBYTE,int*,PBYTE,int*); -int __cdecl rsa_get_keyhash(short,PBYTE,int*,PBYTE,int*); -int __cdecl rsa_set_keypair(short,PBYTE,int); -int __cdecl rsa_get_pubkey(HANDLE,PBYTE,int*); -int __cdecl rsa_set_pubkey(HANDLE,PBYTE,int); +int __cdecl rsa_get_keypair(short, uint8_t*,int*, uint8_t*,int*); +int __cdecl rsa_get_keyhash(short,uint8_t*,int*,uint8_t*,int*); +int __cdecl rsa_set_keypair(short,uint8_t*,int); +int __cdecl rsa_get_pubkey(HANDLE,uint8_t*,int*); +int __cdecl rsa_set_pubkey(HANDLE,uint8_t*,int); void __cdecl rsa_set_timeout(int); int __cdecl rsa_get_state(HANDLE); -int __cdecl rsa_get_hash(PBYTE,int,PBYTE,int*); +int __cdecl rsa_get_hash(uint8_t*,int,uint8_t*,int*); int __cdecl rsa_connect(HANDLE); int __cdecl rsa_disconnect(HANDLE); int __cdecl rsa_disabled(HANDLE); diff --git a/plugins/CryptoPP/src/cpp_rsau.cpp b/plugins/CryptoPP/src/cpp_rsau.cpp index 1adf07afd5..bf2266e84a 100644 --- a/plugins/CryptoPP/src/cpp_rsau.cpp +++ b/plugins/CryptoPP/src/cpp_rsau.cpp @@ -108,10 +108,10 @@ int str2int(string& s) string hash(string& b) { - return ::hash((PBYTE)b.data(), b.length()); + return ::hash((uint8_t*)b.data(), b.length()); } -string hash(PBYTE b, size_t l) +string hash(uint8_t *b, size_t l) { BYTE h[RSA_KEYSIZE]; RSA_CalculateDigest(h, b, l); @@ -121,15 +121,15 @@ string hash(PBYTE b, size_t l) string hash128(string& b) { - return hash128((PBYTE)b.data(), b.length()); + return hash128((uint8_t*)b.data(), b.length()); } string hash128(LPSTR b) { - return hash128((PBYTE)b, strlen(b)); + return hash128((uint8_t*)b, strlen(b)); } -string hash128(PBYTE b, size_t l) +string hash128(uint8_t *b, size_t l) { BYTE h[RIPEMD128::DIGESTSIZE]; RIPEMD128().CalculateDigest(h, b, l); @@ -139,15 +139,15 @@ string hash128(PBYTE b, size_t l) string hash256(string& b) { - return hash256((PBYTE)b.data(), b.length()); + return hash256((uint8_t*)b.data(), b.length()); } string hash256(LPSTR b) { - return hash256((PBYTE)b, strlen(b)); + return hash256((uint8_t*)b, strlen(b)); } -string hash256(PBYTE b, size_t l) +string hash256(uint8_t *b, size_t l) { BYTE h[RIPEMD256::DIGESTSIZE]; RIPEMD256().CalculateDigest(h, b, l); @@ -232,5 +232,5 @@ BOOL RSAVerifyString(const RSA::PublicKey& pubkey, const string& plaintext, cons { RSASSA_PKCS1v15_SHA_Verifier ver(pubkey); - return ver.VerifyMessage((PBYTE)plaintext.data(), plaintext.length(), (PBYTE)sig.data(), sig.length()); + return ver.VerifyMessage((uint8_t*)plaintext.data(), plaintext.length(), (uint8_t*)sig.data(), sig.length()); } diff --git a/plugins/CryptoPP/src/cpp_rsau.h b/plugins/CryptoPP/src/cpp_rsau.h index 38ba656f9d..c8b976f1ed 100644 --- a/plugins/CryptoPP/src/cpp_rsau.h +++ b/plugins/CryptoPP/src/cpp_rsau.h @@ -77,15 +77,15 @@ string& un_tlv(string&,int&,int&); int str2int(string&); string hash(string&); -string hash(PBYTE, size_t); +string hash(uint8_t*, size_t); string hash128(string&); string hash128(LPSTR); -string hash128(PBYTE, size_t); +string hash128(uint8_t*, size_t); string hash256(string&); string hash256(LPSTR); -string hash256(PBYTE, size_t); +string hash256(uint8_t*, size_t); Integer BinaryToInteger(const string&); string IntegerToBinary(const Integer&); diff --git a/plugins/CryptoPP/src/cpp_svcs.cpp b/plugins/CryptoPP/src/cpp_svcs.cpp index c7a47f058b..23c05cb5e1 100644 --- a/plugins/CryptoPP/src/cpp_svcs.cpp +++ b/plugins/CryptoPP/src/cpp_svcs.cpp @@ -31,7 +31,7 @@ LPSTR __cdecl cpp_encrypt(pCNTX ptr, LPCSTR szPlainMsg) CBC_Mode::Encryption enc(p->KeyX, Tiger::DIGESTSIZE, IV); StreamTransformationFilter cbcEncryptor(enc, new StringSink(ciphered)); - cbcEncryptor.Put((PBYTE)szMsg, slen); + cbcEncryptor.Put((uint8_t*)szMsg, slen); cbcEncryptor.MessageEnd(); free(szMsg); @@ -99,7 +99,7 @@ LPSTR __cdecl cpp_decrypt(pCNTX ptr, LPCSTR szEncMsg) BYTE crc32[CRC32::DIGESTSIZE]; memset(crc32, 0, sizeof(crc32)); - CRC32().CalculateDigest(crc32, (PBYTE)(bciphered + CRC32::DIGESTSIZE), len); + CRC32().CalculateDigest(crc32, (uint8_t*)(bciphered + CRC32::DIGESTSIZE), len); if (memcmp(crc32, bciphered, CRC32::DIGESTSIZE)) { // message is bad crc #if defined(_DEBUG) || defined(NETLIB_LOG) @@ -117,14 +117,14 @@ LPSTR __cdecl cpp_decrypt(pCNTX ptr, LPCSTR szEncMsg) CBC_Mode::Decryption dec(p->KeyX, Tiger::DIGESTSIZE, IV); StreamTransformationFilter cbcDecryptor(dec, new StringSink(unciphered)); - cbcDecryptor.Put((PBYTE)bciphered, clen); + cbcDecryptor.Put((uint8_t*)bciphered, clen); cbcDecryptor.MessageEnd(); mir_free(ptr->tmp); if (dataflag & DATA_GZIP) { size_t clen2 = clen; - LPSTR res = (LPSTR)cpp_gunzip((PBYTE)unciphered.data(), unciphered.length(), clen2); + LPSTR res = (LPSTR)cpp_gunzip((uint8_t*)unciphered.data(), unciphered.length(), clen2); ptr->tmp = mir_strndup(res, clen2); free(res); } diff --git a/plugins/CryptoPP/src/cryptopp.h b/plugins/CryptoPP/src/cryptopp.h index a98b6204f5..5b8d304c40 100644 --- a/plugins/CryptoPP/src/cryptopp.h +++ b/plugins/CryptoPP/src/cryptopp.h @@ -32,15 +32,15 @@ USING_NAMESPACE(std) #define EMPTYH 0xF1E2D3C4 typedef struct __CNTX { - u_int header; // HEADER - short mode; // mode of encoding - short features; // features of client - short error; // error code of last operation - PBYTE pdata; // data block - PVOID udata; // user data - LPSTR tmp; // return string - u_int deleted; // delete time&flag to delete - u_int footer; // FOOTER + u_int header; // HEADER + short mode; // mode of encoding + short features; // features of client + short error; // error code of last operation + uint8_t* pdata; // data block + PVOID udata; // user data + LPSTR tmp; // return string + u_int deleted; // delete time&flag to delete + u_int footer; // FOOTER } CNTX; typedef CNTX* pCNTX; @@ -69,19 +69,19 @@ typedef CNTX* pCNTX; #define DATA_GZIP 1 typedef struct __SIMDATA { - DH *dh; // diffie-hellman - PBYTE PubA; // public keyA 2048 bit - PBYTE KeyA; // private keyA 2048 bit - PBYTE KeyB; // public keyB 2048 bit - PBYTE KeyX; // secret keyX 192 bit - PBYTE KeyP; // pre-shared keyP 192 bit + DH *dh; // diffie-hellman + uint8_t* PubA; // public keyA 2048 bit + uint8_t* KeyA; // private keyA 2048 bit + uint8_t* KeyB; // public keyB 2048 bit + uint8_t* KeyX; // secret keyX 192 bit + uint8_t* KeyP; // pre-shared keyP 192 bit } SIMDATA; typedef SIMDATA* pSIMDATA; typedef struct __PGPDATA { - PBYTE pgpKeyID; // PGP KeyID - PBYTE pgpKey; // PGP Key + uint8_t* pgpKeyID; // PGP KeyID + uint8_t* pgpKey; // PGP Key } PGPDATA; typedef PGPDATA* pPGPDATA; @@ -162,14 +162,14 @@ string cpp_zlibd(string&); typedef struct { int(__cdecl *rsa_gen_keypair)(short); // генерит RSA-ключи для указанной длины (либо тока 2048, либо 2048 и 4096) - int(__cdecl *rsa_get_keypair)(short, PBYTE, int*, PBYTE, int*); // возвращает пару ключей для указанной длины - int(__cdecl *rsa_get_keyhash)(short, PBYTE, int*, PBYTE, int*); // возвращает hash пары ключей для указанной длины - int(__cdecl *rsa_set_keypair)(short, PBYTE, int); // устанавливает ключи, указанной длины - int(__cdecl *rsa_get_pubkey)(HANDLE, PBYTE, int*); // возвращает паблик ключ из указанного контекста - int(__cdecl *rsa_set_pubkey)(HANDLE, PBYTE, int); // загружает паблик ключ для указанного контекста + int(__cdecl *rsa_get_keypair)(short, uint8_t*, int*, uint8_t*, int*); // возвращает пару ключей для указанной длины + int(__cdecl *rsa_get_keyhash)(short, uint8_t*, int*, uint8_t*, int*); // возвращает hash пары ключей для указанной длины + int(__cdecl *rsa_set_keypair)(short, uint8_t*, int); // устанавливает ключи, указанной длины + int(__cdecl *rsa_get_pubkey)(HANDLE, uint8_t*, int*); // возвращает паблик ключ из указанного контекста + int(__cdecl *rsa_set_pubkey)(HANDLE, uint8_t*, int); // загружает паблик ключ для указанного контекста void(__cdecl *rsa_set_timeout)(int); // установить таймаут для установки секюрного соединения int(__cdecl *rsa_get_state)(HANDLE); // получить статус указанного контекста - int(__cdecl *rsa_get_hash)(PBYTE, int, PBYTE, int*); // вычисляет SHA1(key) + int(__cdecl *rsa_get_hash)(uint8_t*, int, uint8_t*, int*); // вычисляет SHA1(key) int(__cdecl *rsa_connect)(HANDLE); // запускает процесс установки содинения с указанным контекстом int(__cdecl *rsa_disconnect)(HANDLE); // разрывает соединение с указанным контекстом int(__cdecl *rsa_disabled)(HANDLE); // разрывает соединение по причине "disabled" @@ -190,7 +190,7 @@ typedef RSA_EXPORT* pRSA_EXPORT; typedef struct { int(__cdecl *rsa_inject)(HANDLE, LPCSTR); // вставляет сообщение в очередь на отправку - int(__cdecl *rsa_check_pub)(HANDLE, PBYTE, int, PBYTE, int); // проверяет интерактивно SHA и сохраняет ключ, если все нормально + int(__cdecl *rsa_check_pub)(HANDLE, uint8_t*, int, uint8_t*, int); // проверяет интерактивно SHA и сохраняет ключ, если все нормально void(__cdecl *rsa_notify)(HANDLE, int); // нотификация о смене состояния } RSA_IMPORT; typedef RSA_IMPORT* pRSA_IMPORT; diff --git a/plugins/CryptoPP/src/main.cpp b/plugins/CryptoPP/src/main.cpp index 0b305a9949..bdc059828a 100644 --- a/plugins/CryptoPP/src/main.cpp +++ b/plugins/CryptoPP/src/main.cpp @@ -61,7 +61,7 @@ BOOL ExtractFileFromResource(HANDLE FH, int ResType, int ResId, DWORD* Size) if (RH == nullptr) return FALSE; - PBYTE RP = (PBYTE)LoadResource(g_plugin.getInst(), RH); + uint8_t *RP = (uint8_t*)LoadResource(g_plugin.getInst(), RH); if (RP == nullptr) return FALSE; diff --git a/plugins/Db3x_mmap/src/dbcache.cpp b/plugins/Db3x_mmap/src/dbcache.cpp index 73c0475858..4d9cee8392 100644 --- a/plugins/Db3x_mmap/src/dbcache.cpp +++ b/plugins/Db3x_mmap/src/dbcache.cpp @@ -33,7 +33,7 @@ void CDb3Mmap::Map() m_hMap = CreateFileMapping(m_hDbFile, nullptr, dwProtectMode, 0, m_dwFileSize, nullptr); if (m_hMap) { - m_pDbCache = (PBYTE)MapViewOfFile(m_hMap, dwAccess, 0, 0, 0); + m_pDbCache = (uint8_t*)MapViewOfFile(m_hMap, dwAccess, 0, 0, 0); if (!m_pDbCache) DatabaseCorruption(L"%s (MapViewOfFile failed. Code: %d)"); } @@ -85,7 +85,7 @@ void CDb3Mmap::DBMoveChunk(DWORD ofsDest, DWORD ofsSource, int bytes) } //we are assumed to be in a mutex here -PBYTE CDb3Mmap::DBRead(DWORD ofs, int *bytesAvail) +uint8_t* CDb3Mmap::DBRead(DWORD ofs, int *bytesAvail) { // buggy read if (ofs >= m_dwFileSize) { @@ -175,7 +175,7 @@ int CDb3Mmap::InitMap(void) Map(); // zero region for reads outside the file - m_pNull = (PBYTE)calloc(m_ChunkSize, 1); + m_pNull = (uint8_t*)calloc(m_ChunkSize, 1); return 0; } diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp index 19aebdc779..04e4aa5a78 100644 --- a/plugins/Db3x_mmap/src/dbcontacts.cpp +++ b/plugins/Db3x_mmap/src/dbcontacts.cpp @@ -216,18 +216,18 @@ BOOL CDb3Mmap::MetaMergeHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) dbMeta->eventCount = arEvents.getCount(); DBEvent *pFirst = arEvents[0]; - dbMeta->ofsFirstEvent = DWORD(PBYTE(pFirst) - m_pDbCache); + dbMeta->ofsFirstEvent = DWORD((uint8_t*)pFirst - m_pDbCache); pFirst->ofsPrev = 0; dbMeta->ofsFirstUnread = pFirst->markedRead() ? 0 : dbMeta->ofsFirstEvent; DBEvent *pLast = arEvents[arEvents.getCount() - 1]; - dbMeta->ofsLastEvent = DWORD(PBYTE(pLast) - m_pDbCache); + dbMeta->ofsLastEvent = DWORD((uint8_t*)pLast - m_pDbCache); pLast->ofsNext = 0; for (int i = 1; i < arEvents.getCount(); i++) { DBEvent *pPrev = arEvents[i - 1], *pNext = arEvents[i]; - pPrev->ofsNext = DWORD(PBYTE(pNext) - m_pDbCache); - pNext->ofsPrev = DWORD(PBYTE(pPrev) - m_pDbCache); + pPrev->ofsNext = DWORD((uint8_t*)pNext - m_pDbCache); + pNext->ofsPrev = DWORD((uint8_t*)pPrev - m_pDbCache); if (dbMeta->ofsFirstUnread == 0 && !pNext->markedRead()) dbMeta->ofsFirstUnread = pPrev->ofsNext; @@ -280,7 +280,7 @@ BOOL CDb3Mmap::MetaSplitHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) dbSub.eventCount++; if (evSub != nullptr) { evSub->ofsNext = dwOffset; - evCurr->ofsPrev = DWORD(PBYTE(evSub) - m_pDbCache); + evCurr->ofsPrev = DWORD((uint8_t*)evSub - m_pDbCache); } else { dbSub.ofsFirstEvent = dwOffset; @@ -297,7 +297,7 @@ BOOL CDb3Mmap::MetaSplitHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) dbMeta.eventCount++; if (evMeta != nullptr) { evMeta->ofsNext = dwOffset; - evCurr->ofsPrev = DWORD(PBYTE(evMeta) - m_pDbCache); + evCurr->ofsPrev = DWORD((uint8_t*)evMeta - m_pDbCache); } else { dbMeta.ofsFirstEvent = dwOffset; diff --git a/plugins/Db3x_mmap/src/dbcrypt.cpp b/plugins/Db3x_mmap/src/dbcrypt.cpp index 01cafc0271..7778535d2c 100644 --- a/plugins/Db3x_mmap/src/dbcrypt.cpp +++ b/plugins/Db3x_mmap/src/dbcrypt.cpp @@ -39,7 +39,7 @@ struct VarDescr iLen(0) {} - VarDescr(LPCSTR var, PBYTE value, int len) : + VarDescr(LPCSTR var, uint8_t *value, int len) : szVar(mir_strdup(var)), szValue((char*)memcpy(mir_alloc(len), value, len)), iLen(len) @@ -119,7 +119,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::StoreProvider(CRYPTO_PROVIDER *pProvider) { DBCONTACTWRITESETTING dbcws = { "CryptoEngine", "Provider" }; dbcws.value.type = DBVT_BLOB; - dbcws.value.pbVal = (PBYTE)pProvider->pszName; + dbcws.value.pbVal = (uint8_t*)pProvider->pszName; dbcws.value.cpbVal = (WORD)mir_strlen(pProvider->pszName) + 1; WriteContactSetting(0, &dbcws); return TRUE; @@ -182,7 +182,7 @@ void CDb3Mmap::ToggleSettingsEncryption(MCONTACT contactID) char szSetting[256]; int bytesRemaining, len; DWORD ofsBlobPtr = offset + offsetof(DBContactSettings, blob), ofsNext = setting->ofsNext; - PBYTE pBlob = (PBYTE)DBRead(ofsBlobPtr, &bytesRemaining); + uint8_t *pBlob = (uint8_t*)DBRead(ofsBlobPtr, &bytesRemaining); while (pBlob[0]) { NeedBytes(1); len = pBlob[0]; @@ -247,7 +247,7 @@ void CDb3Mmap::ToggleSettingsEncryption(MCONTACT contactID) } else { size_t realLen; - ptrA decoded(m_crypto->decodeString((PBYTE)(char*)p->szValue, p->iLen, &realLen)); + ptrA decoded(m_crypto->decodeString((uint8_t*)(char*)p->szValue, p->iLen, &realLen)); if (decoded != nullptr) { DBCONTACTWRITESETTING dbcws = { szModule, p->szVar }; dbcws.value.type = DBVT_UNENCRYPTED; diff --git a/plugins/Db3x_mmap/src/dbevents.cpp b/plugins/Db3x_mmap/src/dbevents.cpp index 0b4aeb4a18..69928a404c 100644 --- a/plugins/Db3x_mmap/src/dbevents.cpp +++ b/plugins/Db3x_mmap/src/dbevents.cpp @@ -296,7 +296,7 @@ BOOL CDb3Mmap::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei) DWORD cbBlob = dbe->cbBlob; size_t bytesToCopy = cbBlob; if (dbei->cbBlob == -1) - dbei->pBlob = (PBYTE)mir_calloc(cbBlob + 2); + dbei->pBlob = (uint8_t*)mir_calloc(cbBlob + 2); else if (dbei->cbBlob < cbBlob) bytesToCopy = dbei->cbBlob; diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h index 67dc4b084e..43907534cf 100644 --- a/plugins/Db3x_mmap/src/dbintf.h +++ b/plugins/Db3x_mmap/src/dbintf.h @@ -65,10 +65,10 @@ DBHeader #define MARKED_READ (DBEF_READ | DBEF_SENT) -#define NeedBytes(n) if (bytesRemaining<(n)) pBlob = (PBYTE)DBRead(ofsBlobPtr,&bytesRemaining) +#define NeedBytes(n) if (bytesRemaining<(n)) pBlob = (uint8_t*)DBRead(ofsBlobPtr,&bytesRemaining) #define MoveAlong(n) {int x = n; pBlob += (x); ofsBlobPtr += (x); bytesRemaining -= (x);} -DWORD __forceinline GetSettingValueLength(PBYTE pSetting) +DWORD __forceinline GetSettingValueLength(uint8_t *pSetting) { if (pSetting[0] & DBVTF_VARIABLELENGTH) return 2 + *(PWORD)(pSetting + 1); @@ -245,24 +245,24 @@ public: STDMETHODIMP_(DATABASELINK*) GetDriver() override; protected: - DWORD GetSettingsGroupOfsByModuleNameOfs(DBContact *dbc, DWORD ofsModuleName); - void InvalidateSettingsGroupOfsCacheEntry(DWORD) {} + DWORD GetSettingsGroupOfsByModuleNameOfs(DBContact *dbc, DWORD ofsModuleName); + void InvalidateSettingsGroupOfsCacheEntry(DWORD) {} - void DBMoveChunk(DWORD ofsDest, DWORD ofsSource, int bytes); - PBYTE DBRead(DWORD ofs, int *bytesAvail); - void DBWrite(DWORD ofs, PVOID pData, int bytes); - void DBFill(DWORD ofs, int bytes); - void DBFlush(int setting); - int InitMap(void); - void FillContacts(void); + void DBMoveChunk(DWORD ofsDest, DWORD ofsSource, int bytes); + uint8_t* DBRead(DWORD ofs, int *bytesAvail); + void DBWrite(DWORD ofs, PVOID pData, int bytes); + void DBFill(DWORD ofs, int bytes); + void DBFlush(int setting); + int InitMap(void); + void FillContacts(void); - PBYTE m_pNull; + uint8_t* m_pNull; - void Map(); - void ReMap(DWORD needed); + void Map(); + void ReMap(DWORD needed); protected: - wchar_t* m_tszProfileName; + wchar_t* m_tszProfileName; HANDLE m_hDbFile; DBHeader m_dbHeader; DWORD m_ChunkSize; @@ -273,7 +273,7 @@ protected: public: UINT_PTR m_flushBuffersTimerId; DWORD m_flushFailTick; - PBYTE m_pDbCache; + uint8_t* m_pDbCache; HANDLE m_hMap; protected: diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp index f435c3a98c..9ed7ba662e 100644 --- a/plugins/Db3x_mmap/src/dbsettings.cpp +++ b/plugins/Db3x_mmap/src/dbsettings.cpp @@ -103,7 +103,7 @@ LBL_Seek: int bytesRemaining; unsigned varLen; DWORD ofsBlobPtr = ofsSettingsGroup + offsetof(DBContactSettings, blob); - PBYTE pBlob = DBRead(ofsBlobPtr, &bytesRemaining); + uint8_t *pBlob = DBRead(ofsBlobPtr, &bytesRemaining); while (pBlob[0]) { NeedBytes(1 + settingNameLen); if (pBlob[0] == settingNameLen && !memcmp(pBlob + 1, szSetting, settingNameLen)) { @@ -236,7 +236,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::WriteContactSettingWorker(MCONTACT contactID, DBCO return 1; // make sure the module group exists - PBYTE pBlob; + uint8_t *pBlob; int bytesRequired, bytesRemaining; DBContactSettings dbcs; DWORD ofsSettingsGroup = GetSettingsGroupOfsByModuleNameOfs(&dbc, ofsModuleName); @@ -263,14 +263,14 @@ STDMETHODIMP_(BOOL) CDb3Mmap::WriteContactSettingWorker(MCONTACT contactID, DBCO DBWrite(ofsContact, &dbc, sizeof(DBContact)); DBWrite(ofsSettingsGroup, &dbcs, sizeof(DBContactSettings)); ofsBlobPtr = ofsSettingsGroup + offsetof(DBContactSettings, blob); - pBlob = (PBYTE)DBRead(ofsBlobPtr, &bytesRemaining); + pBlob = (uint8_t*)DBRead(ofsBlobPtr, &bytesRemaining); } else { dbcs = *(DBContactSettings*)DBRead(ofsSettingsGroup, &bytesRemaining); // find if the setting exists ofsBlobPtr = ofsSettingsGroup + offsetof(DBContactSettings, blob); - pBlob = (PBYTE)DBRead(ofsBlobPtr, &bytesRemaining); + pBlob = (uint8_t*)DBRead(ofsBlobPtr, &bytesRemaining); while (pBlob[0]) { NeedBytes(settingNameLen + 1); if (pBlob[0] == settingNameLen && !memcmp(pBlob + 1, dbcws.szSetting, settingNameLen)) @@ -306,7 +306,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::WriteContactSettingWorker(MCONTACT contactID, DBCO } DBMoveChunk(ofsSettingToCut, ofsSettingToCut + nameLen + valLen, ofsBlobPtr + 1 - ofsSettingToCut); ofsBlobPtr -= nameLen + valLen; - pBlob = (PBYTE)DBRead(ofsBlobPtr, &bytesRemaining); + pBlob = (uint8_t*)DBRead(ofsBlobPtr, &bytesRemaining); } else { // replace existing setting at pBlob @@ -386,7 +386,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::WriteContactSettingWorker(MCONTACT contactID, DBCO } ofsBlobPtr += ofsNew - ofsSettingsGroup; ofsSettingsGroup = ofsNew; - pBlob = (PBYTE)DBRead(ofsBlobPtr, &bytesRemaining); + pBlob = (uint8_t*)DBRead(ofsBlobPtr, &bytesRemaining); } // we now have a place to put it and enough space: make it @@ -467,7 +467,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::DeleteContactSetting(MCONTACT contactID, LPCSTR sz // find if the setting exists DWORD ofsBlobPtr = ofsSettingsGroup + offsetof(DBContactSettings, blob); int bytesRemaining; - PBYTE pBlob = (PBYTE)DBRead(ofsBlobPtr, &bytesRemaining); + uint8_t *pBlob = (uint8_t*)DBRead(ofsBlobPtr, &bytesRemaining); while (pBlob[0]) { NeedBytes(settingNameLen + 1); if (pBlob[0] == settingNameLen && !memcmp(pBlob + 1, szSetting, settingNameLen)) @@ -539,7 +539,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::EnumContactSettings(MCONTACT contactID, DBSETTINGE DWORD ofsBlobPtr = ofsSettings + offsetof(DBContactSettings, blob); int bytesRemaining; - PBYTE pBlob = (PBYTE)DBRead(ofsBlobPtr, &bytesRemaining); + uint8_t *pBlob = (uint8_t*)DBRead(ofsBlobPtr, &bytesRemaining); if (pBlob[0] == 0) return -1; diff --git a/plugins/DbChecker/src/worker.cpp b/plugins/DbChecker/src/worker.cpp index 0c39577ec4..390dd42921 100644 --- a/plugins/DbChecker/src/worker.cpp +++ b/plugins/DbChecker/src/worker.cpp @@ -51,7 +51,7 @@ static bool ConvertOldEvent(DBEVENTINFO &dbei) dbei.flags |= DBEF_UTF; dbei.cbBlob = (DWORD)mir_strlen(utf8str); - dbei.pBlob = (PBYTE)utf8str; + dbei.pBlob = (uint8_t*)utf8str; return true; } diff --git a/plugins/Dbx_mdbx/src/dbevents.cpp b/plugins/Dbx_mdbx/src/dbevents.cpp index cb0b910abe..8bfd07e297 100644 --- a/plugins/Dbx_mdbx/src/dbevents.cpp +++ b/plugins/Dbx_mdbx/src/dbevents.cpp @@ -313,7 +313,7 @@ BOOL CDbxMDBX::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei) DWORD cbBlob = dbe->cbBlob; size_t bytesToCopy = cbBlob; if (dbei->cbBlob == -1) - dbei->pBlob = (PBYTE)mir_calloc(cbBlob + 2); + dbei->pBlob = (uint8_t*)mir_calloc(cbBlob + 2); else if (dbei->cbBlob < cbBlob) bytesToCopy = dbei->cbBlob; diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp index a4a56eed84..1bd57740f5 100755 --- a/plugins/Dbx_sqlite/src/dbevents.cpp +++ b/plugins/Dbx_sqlite/src/dbevents.cpp @@ -312,7 +312,7 @@ BOOL CDbxSQLite::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei) DWORD cbBlob = sqlite3_column_int64(stmt, 4); size_t bytesToCopy = cbBlob; if (dbei->cbBlob == -1) - dbei->pBlob = (PBYTE)mir_calloc(cbBlob + 2); + dbei->pBlob = (uint8_t*)mir_calloc(cbBlob + 2); else if (dbei->cbBlob < cbBlob) bytesToCopy = dbei->cbBlob; diff --git a/plugins/Exchange/src/utils.cpp b/plugins/Exchange/src/utils.cpp index a4f7efb340..9b35b8700f 100644 --- a/plugins/Exchange/src/utils.cpp +++ b/plugins/Exchange/src/utils.cpp @@ -82,7 +82,7 @@ int Info(char *title, char *format, ...) #define HEX_SIZE 8 -char *BinToHex(int size, PBYTE data) +char *BinToHex(int size, uint8_t *data) { char *szresult = nullptr; int maxSize = size * 2 + HEX_SIZE + 1; diff --git a/plugins/Exchange/src/utils.h b/plugins/Exchange/src/utils.h index 8e3b63aa0c..a25ac22feb 100644 --- a/plugins/Exchange/src/utils.h +++ b/plugins/Exchange/src/utils.h @@ -33,8 +33,8 @@ int LogInit(); int Log(char *format, ...); int Info(char *title, char *format, ...); -char *BinToHex(int size, PBYTE data); -void HexToBin(wchar_t *inData, ULONG &size, PBYTE &outData); +char *BinToHex(int size, uint8_t *data); +void HexToBin(wchar_t *inData, ULONG &size, uint8_t *&outData); void ScreenToClient(HWND hWnd, LPRECT rect); diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp index e01328b428..ec6629cc06 100644 --- a/plugins/FTPFileYM/src/job_upload.cpp +++ b/plugins/FTPFileYM/src/job_upload.cpp @@ -90,7 +90,7 @@ void UploadJob::autoSend() dbei.szModule = szProto; dbei.timestamp = (DWORD)time(0); dbei.cbBlob = (DWORD)mir_strlen(m_szFileLink) + 1; - dbei.pBlob = (PBYTE)m_szFileLink; + dbei.pBlob = (uint8_t*)m_szFileLink; db_event_add(m_hContact, &dbei); ProtoChainSend(m_hContact, PSS_MESSAGE, 0, (LPARAM)m_szFileLink); CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)m_hContact, 0); diff --git a/plugins/HistoryStats/src/mirandacontact.cpp b/plugins/HistoryStats/src/mirandacontact.cpp index 66de169919..81f86461ed 100644 --- a/plugins/HistoryStats/src/mirandacontact.cpp +++ b/plugins/HistoryStats/src/mirandacontact.cpp @@ -28,7 +28,7 @@ void MirandaContact::fetchSlot(int i) if (ei.dbe.cbBlob > ei.nAllocated) { ei.nAllocated = ei.dbe.cbBlob; - ei.dbe.pBlob = reinterpret_cast(realloc(ei.dbe.pBlob, ei.dbe.cbBlob + 1)); + ei.dbe.pBlob = reinterpret_cast(realloc(ei.dbe.pBlob, ei.dbe.cbBlob + 1)); } db_event_get(ci.hEvent, &ei.dbe); diff --git a/plugins/IEHistory/src/dlgHandlers.cpp b/plugins/IEHistory/src/dlgHandlers.cpp index 4fcab2bdf9..7d8e8a62da 100644 --- a/plugins/IEHistory/src/dlgHandlers.cpp +++ b/plugins/IEHistory/src/dlgHandlers.cpp @@ -114,7 +114,7 @@ int DestroyIEView(HWND hWnd) return 0; } -void FillIEViewInfo(IEVIEWEVENTDATA *fillData, DBEVENTINFO dbInfo, PBYTE blob) +void FillIEViewInfo(IEVIEWEVENTDATA *fillData, DBEVENTINFO dbInfo, uint8_t *blob) { switch (dbInfo.eventType) { case EVENTTYPE_MESSAGE: @@ -133,7 +133,7 @@ void FillIEViewInfo(IEVIEWEVENTDATA *fillData, DBEVENTINFO dbInfo, PBYTE blob) fillData->dwFlags = (dbInfo.flags & DBEF_SENT) ? IEEDF_SENT : 0; fillData->time = dbInfo.timestamp; size_t len = mir_strlen((char *)blob) + 1; - PBYTE pos; + uint8_t *pos; fillData->szText.a = (char *)blob; if (len < dbInfo.cbBlob) { @@ -154,7 +154,7 @@ DWORD WINAPI WorkerThread(LPVOID lpvData) int cLoad = LOAD_COUNT; int i; IEVIEWEVENTDATA ieData[LOAD_COUNT] = { 0 }; - PBYTE messages[LOAD_COUNT] = {}; + uint8_t *messages[LOAD_COUNT] = {}; MEVENT dbEvent = data->ieEvent.hDbEventFirst; for (i = 0; i < LOAD_COUNT; i++) ieData[i].next = &ieData[i + 1]; //it's a vector, so v[i]'s next element is v[i + 1] @@ -164,7 +164,7 @@ DWORD WINAPI WorkerThread(LPVOID lpvData) ieEvent.iType = IEE_LOG_MEM_EVENTS; ieEvent.eventData = ieData; DBEVENTINFO dbInfo = {}; - PBYTE buffer = nullptr; + uint8_t *buffer = nullptr; int newSize, oldSize = 0; while (count < target) { cLoad = (count + LOAD_COUNT > target) ? target - count : LOAD_COUNT; @@ -173,11 +173,11 @@ DWORD WINAPI WorkerThread(LPVOID lpvData) for (i = 0; i < cLoad; i++) { newSize = db_event_getBlobSize(dbEvent); if (newSize > oldSize) { - buffer = (PBYTE)realloc(buffer, newSize); + buffer = (uint8_t*)realloc(buffer, newSize); dbInfo.pBlob = buffer; oldSize = newSize; } - messages[i] = (PBYTE)realloc(messages[i], newSize); + messages[i] = (uint8_t*)realloc(messages[i], newSize); dbInfo.cbBlob = newSize; if (!db_event_get(dbEvent, &dbInfo)) { memcpy(messages[i], dbInfo.pBlob, newSize); diff --git a/plugins/IEHistory/src/utils.cpp b/plugins/IEHistory/src/utils.cpp index 4497163ab4..8084269bea 100644 --- a/plugins/IEHistory/src/utils.cpp +++ b/plugins/IEHistory/src/utils.cpp @@ -135,7 +135,7 @@ SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchDat buffer = (wchar_t *)realloc(buffer, newSize); oldSize = newSize; } - dbEvent.pBlob = (PBYTE)buffer; + dbEvent.pBlob = (uint8_t*)buffer; dbEvent.cbBlob = newSize; if (db_event_get(hEvent, &dbEvent) == 0) { //successful switch (type) { diff --git a/plugins/Import/src/dbrw/dbevents.cpp b/plugins/Import/src/dbrw/dbevents.cpp index 92e100737d..fb7f3c66bd 100644 --- a/plugins/Import/src/dbrw/dbevents.cpp +++ b/plugins/Import/src/dbrw/dbevents.cpp @@ -88,7 +88,7 @@ STDMETHODIMP_(BOOL) CDbxSQLite::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei) DWORD cbBlob = sqlite3_column_int(stmt, 5); size_t bytesToCopy = cbBlob; if (dbei->cbBlob == -1) - dbei->pBlob = (PBYTE)mir_calloc(cbBlob + 2); + dbei->pBlob = (uint8_t*)mir_calloc(cbBlob + 2); else if (dbei->cbBlob < cbBlob) bytesToCopy = dbei->cbBlob; diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index ca3e78f33c..1dccf81d41 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -880,7 +880,7 @@ void CImportBatch::ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int bool bSkipAll = false; DWORD cbAlloc = 4096; - BYTE *eventBuf = (PBYTE)mir_alloc(cbAlloc); + BYTE *eventBuf = (uint8_t*)mir_alloc(cbAlloc); // Get the start of the event chain int i = 0; @@ -893,7 +893,7 @@ void CImportBatch::ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int dbei.cbBlob = srcDb->GetBlobSize(hEvent); if (dbei.cbBlob > cbAlloc) { cbAlloc = dbei.cbBlob + 4096 - dbei.cbBlob % 4096; - eventBuf = (PBYTE)mir_realloc(eventBuf, cbAlloc); + eventBuf = (uint8_t*)mir_realloc(eventBuf, cbAlloc); } dbei.pBlob = eventBuf; diff --git a/plugins/Import/src/patterns.cpp b/plugins/Import/src/patterns.cpp index 74fb9620dc..eda1d988c8 100644 --- a/plugins/Import/src/patterns.cpp +++ b/plugins/Import/src/patterns.cpp @@ -567,7 +567,7 @@ public: dbei->timestamp = RLInteger(&pMsg[0x12]); dbei->timestamp -= TimeZone_ToLocal(dbei->timestamp) - dbei->timestamp; // deduct time zone offset from timestamp dbei->cbBlob = RLWord(&pMsg[m_iMsgHeaderSize - 2]); - dbei->pBlob = (PBYTE)mir_alloc(dbei->cbBlob + 1); + dbei->pBlob = (uint8_t*)mir_alloc(dbei->cbBlob + 1); memcpy(dbei->pBlob, pMsg + m_iMsgHeaderSize, dbei->cbBlob); if (m_iFileVersion != 1) for (int i = 0; i < dbei->cbBlob; i++) { diff --git a/plugins/Import/src/textjson.cpp b/plugins/Import/src/textjson.cpp index 06d5cd50ea..c6cb30efb9 100644 --- a/plugins/Import/src/textjson.cpp +++ b/plugins/Import/src/textjson.cpp @@ -171,7 +171,7 @@ public: buf.append(&tmp, 1); dbei->cbBlob = (int)buf.length(); - dbei->pBlob = (PBYTE)mir_alloc(dbei->cbBlob); + dbei->pBlob = (uint8_t*)mir_alloc(dbei->cbBlob); memcpy(dbei->pBlob, buf.data(), buf.length()); } else { @@ -194,7 +194,7 @@ public: dbei->flags |= DBEF_UTF; dbei->cbBlob = (DWORD)szBody.size() + offset; - dbei->pBlob = (PBYTE)mir_calloc(dbei->cbBlob + 1); + dbei->pBlob = (uint8_t*)mir_calloc(dbei->cbBlob + 1); memcpy(dbei->pBlob + offset, szBody.c_str(), szBody.size()); dbei->pBlob[dbei->cbBlob] = 0; } diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index 9d200955f8..92904ae800 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -297,7 +297,7 @@ void MirandaUtils::addMessageToDB(MCONTACT hContact, char* msgBuffer, std::size_ dbei.szModule = targetHandleSzProto; dbei.timestamp = (DWORD)time(0); dbei.cbBlob = (DWORD)bufSize; - dbei.pBlob = (PBYTE)msgBuffer; + dbei.pBlob = (uint8_t*)msgBuffer; db_event_add(hContact, &dbei); } diff --git a/plugins/MirLua/src/Modules/m_message.cpp b/plugins/MirLua/src/Modules/m_message.cpp index 5c847d5194..42e1de78c0 100644 --- a/plugins/MirLua/src/Modules/m_message.cpp +++ b/plugins/MirLua/src/Modules/m_message.cpp @@ -39,7 +39,7 @@ static int message_Send(lua_State *L) dbei.timestamp = time(0); dbei.eventType = EVENTTYPE_MESSAGE; dbei.cbBlob = (DWORD)mir_strlen(message); - dbei.pBlob = (PBYTE)mir_strdup(message); + dbei.pBlob = (uint8_t*)mir_strdup(message); dbei.flags = DBEF_UTF | DBEF_SENT; db_event_add(hContact, &dbei); diff --git a/plugins/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/src/dbfilter.cpp index c1a4a438d4..29b774dff9 100644 --- a/plugins/MirOTR/src/dbfilter.cpp +++ b/plugins/MirOTR/src/dbfilter.cpp @@ -115,7 +115,7 @@ int OnDatabaseEventAdded(WPARAM hContact, LPARAM lParam) DBEVENTINFO info = {}; info.cbBlob = len * 2; - info.pBlob = (PBYTE)_alloca(info.cbBlob); + info.pBlob = (uint8_t*)_alloca(info.cbBlob); if (db_event_get(lParam, &info)) return 0; diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 00ed5f39ac..944d5c3f16 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -656,7 +656,7 @@ void CAppletManager::FinishMessageJob(SMessageJob *pJob) return; dbei.cbBlob = pJob->iBufferSize; - dbei.pBlob = (PBYTE)pJob->pcBuffer; + dbei.pBlob = (uint8_t*)pJob->pcBuffer; db_event_add(pJob->hContact, &dbei); } diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDConnection.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDConnection.cpp index 084722b8cf..3b5dfd7ef4 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDConnection.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDConnection.cpp @@ -131,7 +131,7 @@ int CLCDConnection::GetColorCount() //************************************************************************ // Get the pointer to the pixel buffer //************************************************************************ -PBYTE CLCDConnection::GetPixelBuffer() +uint8_t *CLCDConnection::GetPixelBuffer() { return nullptr; } diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDConnection.h b/plugins/MirandaG15/src/LCDFramework/CLCDConnection.h index 9c17b81d75..9da366db19 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDConnection.h +++ b/plugins/MirandaG15/src/LCDFramework/CLCDConnection.h @@ -64,7 +64,7 @@ public: virtual int GetColorCount(); // Get the pointer to the pixel buffer - virtual PBYTE GetPixelBuffer(); + virtual uint8_t *GetPixelBuffer(); public: CLCDConnection(); diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp index a6902e6a55..890f1b9bb0 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp @@ -287,7 +287,7 @@ bool CLCDConnectionLogitech::Connect(int iIndex) m_pPixels = OpenContext.deviceType == LGLCD_DEVICE_QVGA ? m_lcdBitmap.bmp_qvga32.pixels : m_lcdBitmap.bmp_mono.pixels; m_iPixels = OpenContext.deviceType == LGLCD_DEVICE_QVGA ? sizeof(m_lcdBitmap.bmp_qvga32.pixels) : sizeof(m_lcdBitmap.bmp_mono.pixels); - m_pDrawingBuffer = (PBYTE)malloc(m_iPixels); + m_pDrawingBuffer = (uint8_t*)malloc(m_iPixels); memset(m_pDrawingBuffer, 0, m_iPixels); m_iPriority = LGLCD_PRIORITY_NORMAL; @@ -615,12 +615,12 @@ int CLCDConnectionLogitech::GetColorCount() //************************************************************************ // Get the pointer to the pixel buffer //************************************************************************ -PBYTE CLCDConnectionLogitech::GetPixelBuffer() +uint8_t *CLCDConnectionLogitech::GetPixelBuffer() { if (!GetConnectionState() == CONNECTED) return nullptr; - return (PBYTE)m_pDrawingBuffer; + return (uint8_t*)m_pDrawingBuffer; } //************************************************************************ diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.h b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.h index 38d897e6d9..c3bf9f78c5 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.h +++ b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.h @@ -78,7 +78,7 @@ public: int GetColorCount(); // Returns a pointer to the pixel buffer - PBYTE GetPixelBuffer(); + uint8_t *GetPixelBuffer(); //---------------------------------------------- // Special functions to control the lights @@ -101,7 +101,7 @@ public: //---------------------------------------------- void runDrawingThread(); private: - PBYTE m_pDrawingBuffer; + uint8_t *m_pDrawingBuffer; CLgLCDDevice *m_pConnectedDevice; // the connection instance diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp index 7712cf1d36..241ddddd30 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp @@ -49,7 +49,7 @@ CLCDGfx::~CLCDGfx(void) //************************************************************************ // CLCDGfx::Initialize //************************************************************************ -bool CLCDGfx::Initialize(int nWidth, int nHeight, int nBPP, PBYTE pLcdBitmapBits) +bool CLCDGfx::Initialize(int nWidth, int nHeight, int nBPP, uint8_t *pLcdBitmapBits) { m_pLcdBitmapBits = pLcdBitmapBits; @@ -365,8 +365,8 @@ void CLCDGfx::EndDraw(void) Cache(); } - PBYTE pScreen1 = m_pSavedBitmapBits; - PBYTE pScreen2 = m_pBitmapBits; + uint8_t *pScreen1 = m_pSavedBitmapBits; + uint8_t *pScreen2 = m_pBitmapBits; DWORD dwTimeElapsed = GetTickCount() - m_dwTransitionStart; @@ -550,7 +550,7 @@ HBITMAP CLCDGfx::GetHBITMAP(void) return m_hBitmap; } -int CLCDGfx::findNearestMatch(PBYTE targetArray, int iSourceIndex) +int CLCDGfx::findNearestMatch(uint8_t *targetArray, int iSourceIndex) { int startY = iSourceIndex / m_nWidth; int startX = iSourceIndex - (iSourceIndex / m_nWidth)*m_nWidth; diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h index 2cc940e23b..b4e7c3c8e0 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h +++ b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.h @@ -18,7 +18,7 @@ public: CLCDGfx(void); virtual ~CLCDGfx(void); - bool Initialize(int nWidth, int nHeight, int nBPP, PBYTE pBitmapBits); + bool Initialize(int nWidth, int nHeight, int nBPP, uint8_t *pBitmapBits); bool IsInitialized(); bool Shutdown(void); @@ -49,7 +49,7 @@ public: protected: void Cache(); - int findNearestMatch(PBYTE targetArray, int iSourceIndex); + int findNearestMatch(uint8_t *targetArray, int iSourceIndex); void EndTransition(); @@ -63,7 +63,7 @@ protected: HDC m_hDC; HBITMAP m_hBitmap; HBITMAP m_hPrevBitmap; - PBYTE m_pBitmapBits, m_pLcdBitmapBits, m_pSavedBitmapBits; + uint8_t *m_pBitmapBits, *m_pLcdBitmapBits, *m_pSavedBitmapBits; bool m_bInitialized; diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp index c1b31f4ae7..bad9fed4d3 100644 --- a/plugins/MsgPopup/src/main.cpp +++ b/plugins/MsgPopup/src/main.cpp @@ -123,11 +123,11 @@ void HookOnImport(HMODULE hModule, char *lpszImpModName, PVOID lpOrigFunc, PVOID return; for (; pImportDesc->Name; pImportDesc++) { - char *pszModName = (char *)((PBYTE)hModule + pImportDesc->Name); + char *pszModName = (char *)((uint8_t*)hModule + pImportDesc->Name); if (mir_strcmpi(lpszImpModName, pszModName) != 0) continue; - PIMAGE_THUNK_DATA pThunk = (PIMAGE_THUNK_DATA)((PBYTE)hModule + pImportDesc->FirstThunk); + PIMAGE_THUNK_DATA pThunk = (PIMAGE_THUNK_DATA)((uint8_t*)hModule + pImportDesc->FirstThunk); for (; pThunk->u1.Function; pThunk++) { PVOID* ppfn = (PVOID*)&pThunk->u1.Function; if (*ppfn != lpOrigFunc) diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp index 56749a1d7f..fcb7197e0c 100644 --- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp +++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp @@ -72,7 +72,7 @@ void __cdecl AutoreplyDelayThread(CAutoreplyData *ad) dbei.szModule = szProto; dbei.timestamp = time(0); dbei.cbBlob = ReplyLen; - dbei.pBlob = (PBYTE)(char*)pszReply; + dbei.pBlob = (uint8_t*)(char*)pszReply; db_event_add(ad->hContact, &dbei); } diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index b9f493172c..8e6c22d078 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -272,7 +272,7 @@ void LogSMsgToDB(STATUSMSGINFO *smi, const wchar_t *tmplt) DBEVENTINFO dbei = {}; dbei.cbBlob = (DWORD)mir_strlen(blob) + 1; - dbei.pBlob = (PBYTE)blob; + dbei.pBlob = (uint8_t*)blob; dbei.eventType = EVENTTYPE_STATUSCHANGE; dbei.flags = DBEF_READ | DBEF_UTF; dbei.timestamp = (DWORD)time(0); @@ -356,7 +356,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) DBEVENTINFO dbei = {}; dbei.cbBlob = (DWORD)mir_strlen(blob) + 1; - dbei.pBlob = (PBYTE)blob; + dbei.pBlob = (uint8_t*)blob; dbei.eventType = EVENTTYPE_STATUSCHANGE; dbei.flags = DBEF_READ | DBEF_UTF; dbei.timestamp = (DWORD)time(0); diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 3e72eed316..1338e1d031 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -289,7 +289,7 @@ void LogChangeToDB(XSTATUSCHANGE *xsc) DBEVENTINFO dbei = {}; dbei.cbBlob = (DWORD)mir_strlen(blob) + 1; - dbei.pBlob = (PBYTE)(char*)blob; + dbei.pBlob = (uint8_t*)(char*)blob; dbei.eventType = EVENTTYPE_STATUSCHANGE; dbei.flags = DBEF_READ | DBEF_UTF; dbei.timestamp = (DWORD)time(0); diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index cd7941691a..2d0ac82b36 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -761,7 +761,7 @@ int HookSendMsg(WPARAM w, LPARAM l) //mir_free(dbei->pBlob); str_event.insert(0, toUTF8(globals.wszOutopentag.c_str())); str_event.append(toUTF8(globals.wszOutclosetag.c_str())); - dbei->pBlob = (PBYTE)mir_strdup(str_event.c_str()); + dbei->pBlob = (uint8_t*)mir_strdup(str_event.c_str()); dbei->cbBlob = (DWORD)str_event.length() + 1; } diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 08a7c0f319..4b39a37edd 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -476,7 +476,7 @@ void HistoryLog(MCONTACT hContact, const char *msg, DWORD _time, DWORD flags) dbei.flags = DBEF_UTF | flags; dbei.timestamp = (_time) ? _time : (DWORD)time(0); dbei.cbBlob = (DWORD)mir_strlen(msg) + 1; - dbei.pBlob = (PBYTE)msg; + dbei.pBlob = (uint8_t*)msg; db_event_add(hContact, &dbei); } diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index 1112a21959..d9957a0fff 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -291,7 +291,7 @@ void Nudge_SentStatus(CNudgeElement *n, MCONTACT hContact) dbei.timestamp = (DWORD)time(0); dbei.eventType = 1; dbei.cbBlob = (DWORD)mir_strlen(buff) + 1; - dbei.pBlob = (PBYTE)buff; + dbei.pBlob = (uint8_t*)buff; db_event_add(hContact, &dbei); } @@ -305,7 +305,7 @@ void Nudge_ShowStatus(CNudgeElement *n, MCONTACT hContact, DWORD timestamp) dbei.flags = DBEF_UTF; dbei.timestamp = timestamp; dbei.cbBlob = (DWORD)mir_strlen(buff) + 1; - dbei.pBlob = (PBYTE)buff; + dbei.pBlob = (uint8_t*)buff; db_event_add(hContact, &dbei); } diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index 3160663d02..a8b0b869b0 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -118,7 +118,7 @@ static void PasteIt(MCONTACT hContact, int mode) dbei.szModule = szProto; dbei.timestamp = (DWORD)time(0); dbei.cbBlob = (DWORD)mir_strlen(pasteToWeb->szFileLink) + 1; - dbei.pBlob = (PBYTE)pasteToWeb->szFileLink; + dbei.pBlob = (uint8_t*)pasteToWeb->szFileLink; db_event_add(hContact, &dbei); ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)pasteToWeb->szFileLink); } diff --git a/plugins/PluginUpdater/src/checksum.cpp b/plugins/PluginUpdater/src/checksum.cpp index 67b4d8e633..69df01eafd 100644 --- a/plugins/PluginUpdater/src/checksum.cpp +++ b/plugins/PluginUpdater/src/checksum.cpp @@ -22,7 +22,7 @@ int debug = 0; struct MFileMapping { - PBYTE ptr; + uint8_t *ptr; HANDLE hMap, hFile; MFileMapping(const wchar_t *pwszFileName) @@ -34,7 +34,7 @@ struct MFileMapping if (hFile != INVALID_HANDLE_VALUE) hMap = CreateFileMapping(hFile, nullptr, PAGE_WRITECOPY, 0, 0, nullptr); if (hMap) - ptr = (PBYTE)MapViewOfFile(hMap, FILE_MAP_COPY, 0, 0, 0); + ptr = (uint8_t*)MapViewOfFile(hMap, FILE_MAP_COPY, 0, 0, 0); } ~MFileMapping() @@ -50,15 +50,15 @@ struct MFileMapping } }; -static void PatchResourcesDirectory(PIMAGE_RESOURCE_DIRECTORY pIRD, PBYTE pBase); +static void PatchResourcesDirectory(PIMAGE_RESOURCE_DIRECTORY pIRD, uint8_t *pBase); -static void PatchResourceEntry(PIMAGE_RESOURCE_DIRECTORY_ENTRY pIRDE, PBYTE pBase) +static void PatchResourceEntry(PIMAGE_RESOURCE_DIRECTORY_ENTRY pIRDE, uint8_t *pBase) { if (pIRDE->DataIsDirectory) PatchResourcesDirectory(PIMAGE_RESOURCE_DIRECTORY(pBase + pIRDE->OffsetToDirectory), pBase); } -static void PatchResourcesDirectory(PIMAGE_RESOURCE_DIRECTORY pIRD, PBYTE pBase) +static void PatchResourcesDirectory(PIMAGE_RESOURCE_DIRECTORY pIRD, uint8_t *pBase) { UINT i; pIRD->TimeDateStamp = 0; @@ -103,7 +103,7 @@ LBL_NotPE: } else { PIMAGE_NT_HEADERS pINTH = (PIMAGE_NT_HEADERS)(map.ptr + pIDH->e_lfanew); - if ((PBYTE)pINTH + sizeof(IMAGE_NT_HEADERS) >= map.ptr + filesize) + if ((uint8_t*)pINTH + sizeof(IMAGE_NT_HEADERS) >= map.ptr + filesize) return RESULT_CORRUPTED; if (pINTH->Signature != IMAGE_NT_SIGNATURE) @@ -116,7 +116,7 @@ LBL_NotPE: PIMAGE_DATA_DIRECTORY pIDD = nullptr; PIMAGE_DEBUG_DIRECTORY pDBG = nullptr; - PBYTE pRealloc = nullptr; + uint8_t *pRealloc = nullptr; ULONGLONG base = 0; // try to found correct offset independent of architectures @@ -125,14 +125,14 @@ LBL_NotPE: if ((machine == IMAGE_FILE_MACHINE_I386) && (pINTH->FileHeader.SizeOfOptionalHeader >= sizeof(IMAGE_OPTIONAL_HEADER32)) && (pINTH->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC)) { - pIDD = (PIMAGE_DATA_DIRECTORY)((PBYTE)pINTH + offsetof(IMAGE_NT_HEADERS32, OptionalHeader.DataDirectory)); - base = *(DWORD*)((PBYTE)pINTH + offsetof(IMAGE_NT_HEADERS32, OptionalHeader.ImageBase)); + pIDD = (PIMAGE_DATA_DIRECTORY)((uint8_t*)pINTH + offsetof(IMAGE_NT_HEADERS32, OptionalHeader.DataDirectory)); + base = *(DWORD*)((uint8_t*)pINTH + offsetof(IMAGE_NT_HEADERS32, OptionalHeader.ImageBase)); } else if ((machine == IMAGE_FILE_MACHINE_AMD64) && (pINTH->FileHeader.SizeOfOptionalHeader >= sizeof(IMAGE_OPTIONAL_HEADER64)) && (pINTH->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)) { - pIDD = (PIMAGE_DATA_DIRECTORY)((PBYTE)pINTH + offsetof(IMAGE_NT_HEADERS64, OptionalHeader.DataDirectory)); - base = *(ULONGLONG*)((PBYTE)pINTH + offsetof(IMAGE_NT_HEADERS64, OptionalHeader.ImageBase)); + pIDD = (PIMAGE_DATA_DIRECTORY)((uint8_t*)pINTH + offsetof(IMAGE_NT_HEADERS64, OptionalHeader.DataDirectory)); + base = *(ULONGLONG*)((uint8_t*)pINTH + offsetof(IMAGE_NT_HEADERS64, OptionalHeader.ImageBase)); } else return RESULT_CORRUPTED; @@ -155,7 +155,7 @@ LBL_NotPE: // verify image integrity for (DWORD idx = 0; idx < sections; idx++) { PIMAGE_SECTION_HEADER pISH = (PIMAGE_SECTION_HEADER)(map.ptr + offset + idx * sizeof(IMAGE_SECTION_HEADER)); - if (((PBYTE)pISH + sizeof(IMAGE_SECTION_HEADER) > map.ptr + filesize) || (pISH->PointerToRawData + pISH->SizeOfRawData > filesize)) + if (((uint8_t*)pISH + sizeof(IMAGE_SECTION_HEADER) > map.ptr + filesize) || (pISH->PointerToRawData + pISH->SizeOfRawData > filesize)) return RESULT_CORRUPTED; // erase timestamp @@ -183,7 +183,7 @@ LBL_NotPE: for (size_t idx = 0; idx < sections; idx++) { PIMAGE_SECTION_HEADER pISH = (PIMAGE_SECTION_HEADER)(map.ptr + offset + idx * sizeof(IMAGE_SECTION_HEADER)); - if (((PBYTE)pISH + sizeof(IMAGE_SECTION_HEADER) > map.ptr + filesize) || (pISH->PointerToRawData + pISH->SizeOfRawData > filesize)) + if (((uint8_t*)pISH + sizeof(IMAGE_SECTION_HEADER) > map.ptr + filesize) || (pISH->PointerToRawData + pISH->SizeOfRawData > filesize)) return RESULT_CORRUPTED; // erase debug information @@ -206,12 +206,12 @@ LBL_NotPE: if (Contains(pISH, pIBR->VirtualAddress) && pIBR->SizeOfBlock <= blocklen) { DWORD shift = pIBR->VirtualAddress - pISH->VirtualAddress + pISH->PointerToRawData; int len = pIBR->SizeOfBlock - sizeof(IMAGE_BASE_RELOCATION); - PWORD pw = (PWORD)((PBYTE)pIBR + sizeof(IMAGE_BASE_RELOCATION)); + PWORD pw = (PWORD)((uint8_t*)pIBR + sizeof(IMAGE_BASE_RELOCATION)); while (len > 0) { DWORD type = *pw >> 12; DWORD addr = (*pw & 0x0FFF); - PBYTE pAddr = map.ptr + shift + addr; + uint8_t *pAddr = map.ptr + shift + addr; switch (type) { case IMAGE_REL_BASED_HIGHLOW: @@ -250,7 +250,7 @@ LBL_NotPE: if (blocklen <= sizeof(IMAGE_BASE_RELOCATION)) break; - pIBR = (PIMAGE_BASE_RELOCATION)((PBYTE)pIBR + pIBR->SizeOfBlock); + pIBR = (PIMAGE_BASE_RELOCATION)((uint8_t*)pIBR + pIBR->SizeOfBlock); } } diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index cdc4a76c02..fcb0b56b78 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -799,7 +799,7 @@ void AddMessageToDB(MCONTACT hContact, char *msg) dbei.szModule = Proto_GetBaseAccountName(hContact); dbei.timestamp = time(0); dbei.cbBlob = (int)mir_strlen(msg) + 1; - dbei.pBlob = (PBYTE)msg; + dbei.pBlob = (uint8_t*)msg; db_event_add(hContact, &dbei); } diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index 1978bdbbd0..03b1fe1cb5 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -142,7 +142,7 @@ static int ackevent(WPARAM, LPARAM lParam) dbei.szModule = Proto_GetBaseAccountName(hContact); dbei.timestamp = time(0); dbei.cbBlob = (int)mir_strlen(item->sendBuffer) + 1; - dbei.pBlob = (PBYTE)item->sendBuffer; + dbei.pBlob = (uint8_t*)item->sendBuffer; dbei.szId = (char *)pAck->lParam; MessageWindowEvent evt = { item->hSendId, hContact, &dbei }; diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 7d773d201b..76b1a7bde8 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -646,7 +646,7 @@ void LoadMsgLogIcons(void) HDC hdc = GetDC(nullptr); HBITMAP hBmp = CreateCompatibleBitmap(hdc, bih.biWidth, bih.biHeight); HDC hdcMem = CreateCompatibleDC(hdc); - PBYTE pBmpBits = (PBYTE)mir_alloc(widthBytes * bih.biHeight); + uint8_t *pBmpBits = (uint8_t*)mir_alloc(widthBytes * bih.biHeight); HBRUSH hBrush = hBkgBrush; for (int i = 0; i < _countof(pLogIconBmpBits); i++) { switch (i) { diff --git a/plugins/SecureIM/src/crypt_dll.cpp b/plugins/SecureIM/src/crypt_dll.cpp index 0f5e049b9a..4c023ffe0a 100644 --- a/plugins/SecureIM/src/crypt_dll.cpp +++ b/plugins/SecureIM/src/crypt_dll.cpp @@ -80,7 +80,7 @@ BOOL CalculateKeyX(pUinKey ptr, MCONTACT hContact) // do this only if key exchanged is ok // we use a 192bit key int keysize = cpp_size_keyx(); - PBYTE buffer = (PBYTE)alloca(keysize); // buffer for hash + uint8_t *buffer = (uint8_t*)alloca(keysize); // buffer for hash // store key cpp_get_keyx(ptr->cntx, buffer); diff --git a/plugins/SecureIM/src/cryptopp.h b/plugins/SecureIM/src/cryptopp.h index 3bf3fdd778..f6e8da912b 100644 --- a/plugins/SecureIM/src/cryptopp.h +++ b/plugins/SecureIM/src/cryptopp.h @@ -36,14 +36,14 @@ typedef struct { int (__cdecl *rsa_gen_keypair)(short); // генерит RSA-ключи для указанной длины (либо тока 2048, либо 2048 и 4096) - int (__cdecl *rsa_get_keypair)(short,PBYTE,int*,PBYTE,int*); // возвращает пару ключей для указанной длины - int (__cdecl *rsa_get_keyhash)(short,PBYTE,int*,PBYTE,int*); // возвращает hash пары ключей для указанной длины - int (__cdecl *rsa_set_keypair)(short,PBYTE,int); // устанавливает ключи, указанной длины - int (__cdecl *rsa_get_pubkey)(HANDLE,PBYTE,int*); // возвращает паблик ключ из указанного контекста - int (__cdecl *rsa_set_pubkey)(HANDLE,PBYTE,int); // загружает паблик ключ для указанного контекста + int (__cdecl *rsa_get_keypair)(short,uint8_t*,int*,uint8_t*,int*); // возвращает пару ключей для указанной длины + int (__cdecl *rsa_get_keyhash)(short,uint8_t*,int*,uint8_t*,int*); // возвращает hash пары ключей для указанной длины + int (__cdecl *rsa_set_keypair)(short,uint8_t*,int); // устанавливает ключи, указанной длины + int (__cdecl *rsa_get_pubkey)(HANDLE,uint8_t*,int*); // возвращает паблик ключ из указанного контекста + int (__cdecl *rsa_set_pubkey)(HANDLE,uint8_t*,int); // загружает паблик ключ для указанного контекста void (__cdecl *rsa_set_timeout)(int); // установить таймаут для установки секюрного соединения int (__cdecl *rsa_get_state)(HANDLE); // получить статус указанного контекста - int (__cdecl *rsa_get_hash)(PBYTE,int,PBYTE,int*); // вычисляет SHA-1 (key) + int (__cdecl *rsa_get_hash)(uint8_t*,int,uint8_t*,int*); // вычисляет SHA-1 (key) int (__cdecl *rsa_connect)(HANDLE); // запускает процесс установки содинения с указанным контекстом int (__cdecl *rsa_disconnect)(HANDLE); // разрывает соединение с указанным контекстом int (__cdecl *rsa_disabled)(HANDLE); // разрывает соединение по причине "disabled" @@ -64,7 +64,7 @@ typedef RSA_EXPORT* pRSA_EXPORT; typedef struct { int (__cdecl *rsa_inject)(HANDLE,LPCSTR); // вставляет сообщение в очередь на отправку - int (__cdecl *rsa_check_pub)(HANDLE,PBYTE,int,PBYTE,int); // проверяет интерактивно SHA и сохраняет ключ, если все нормально + int (__cdecl *rsa_check_pub)(HANDLE,uint8_t*,int,uint8_t*,int); // проверяет интерактивно SHA и сохраняет ключ, если все нормально void (__cdecl *rsa_notify)(HANDLE,int); // нотификация о смене состояния } RSA_IMPORT; typedef RSA_IMPORT* pRSA_IMPORT; diff --git a/plugins/SecureIM/src/dbevent.cpp b/plugins/SecureIM/src/dbevent.cpp index a809314640..0905da4a5f 100644 --- a/plugins/SecureIM/src/dbevent.cpp +++ b/plugins/SecureIM/src/dbevent.cpp @@ -8,6 +8,6 @@ void HistoryLog(MCONTACT hContact, LPCSTR szText) dbei.timestamp = time(0); dbei.eventType = EVENTTYPE_MESSAGE; dbei.cbBlob = (int)mir_strlen(szText) + 1; - dbei.pBlob = (PBYTE)szText; + dbei.pBlob = (uint8_t*)szText; db_event_add(0, &dbei); } diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index beeeddc9f0..85fa6178fb 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -95,7 +95,7 @@ static int onModulesLoaded(WPARAM, LPARAM) char priv_key[4096]; int priv_len; char pub_key[4096]; int pub_len; - mir_exp->rsa_get_keypair(CPP_MODE_RSA_4096, (PBYTE)&priv_key, &priv_len, (PBYTE)&pub_key, &pub_len); + mir_exp->rsa_get_keypair(CPP_MODE_RSA_4096, (uint8_t*)&priv_key, &priv_len, (uint8_t*)&pub_key, &pub_len); db_set_blob(0, MODULENAME, "rsa_priv", priv_key, priv_len); db_set_blob(0, MODULENAME, "rsa_pub", &pub_key, pub_len); g_plugin.delSetting("rsa_priv_2048"); diff --git a/plugins/SecureIM/src/mmi.cpp b/plugins/SecureIM/src/mmi.cpp index aa6e048882..8e77158930 100644 --- a/plugins/SecureIM/src/mmi.cpp +++ b/plugins/SecureIM/src/mmi.cpp @@ -70,7 +70,7 @@ char* m_ustrcat(LPCSTR strA, LPCSTR strB) LPSTR m_hex = nullptr; -LPSTR to_hex(PBYTE bin, int len) +LPSTR to_hex(uint8_t *bin, int len) { SAFE_FREE(m_hex); m_hex = (LPSTR)mir_alloc(len * 3 + 1); diff --git a/plugins/SecureIM/src/mmi.h b/plugins/SecureIM/src/mmi.h index 022de440de..e82f2419ab 100644 --- a/plugins/SecureIM/src/mmi.h +++ b/plugins/SecureIM/src/mmi.h @@ -5,7 +5,7 @@ char *m_wwstrcat(LPCSTR,LPCSTR); char *m_awstrcat(LPCSTR,LPCSTR); char *m_aastrcat(LPCSTR,LPCSTR); char *m_ustrcat(LPCSTR,LPCSTR); -LPSTR to_hex(PBYTE,int); +LPSTR to_hex(uint8_t*,int); LPSTR utf8_to_miranda(LPCSTR,DWORD&); LPSTR miranda_to_utf8(LPCSTR,DWORD); diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 8f9f7e1209..c0b2880147 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -150,8 +150,8 @@ static void setListViewPUB(HWND hLV, UINT iItem, UINT iStatus) pUinKey ptr = (pUinKey)getListViewParam(hLV, iItem); if (db_get(ptr->hContact, MODULENAME, "rsa_pub", &dbv) == 0) { int len; - mir_exp->rsa_get_hash((PBYTE)dbv.pbVal, dbv.cpbVal, (PBYTE)str, &len); - sha = mir_strdup(to_hex((PBYTE)str, len)); + mir_exp->rsa_get_hash((uint8_t*)dbv.pbVal, dbv.cpbVal, (uint8_t*)str, &len); + sha = mir_strdup(to_hex((uint8_t*)str, len)); db_free(&dbv); } } @@ -773,7 +773,7 @@ static INT_PTR CALLBACK DlgProcOptionsGeneral(HWND hDlg, UINT wMsg, WPARAM wPara if (!LoadImportRSAKeyDlg(hDlg, pub, 0)) return TRUE; if (mir_exp->rsa_import_pubkey(ptr->cntx, pub)) { int len; - mir_exp->rsa_get_pubkey(ptr->cntx, (PBYTE)pub, &len); + mir_exp->rsa_get_pubkey(ptr->cntx, (uint8_t*)pub, &len); db_set_blob(ptr->hContact, MODULENAME, "rsa_pub", pub, len); setListViewPUB(hLV, idx, 1); @@ -979,7 +979,7 @@ static void RefreshProtoDlg(HWND hDlg) EnableWindow(GetDlgItem(hDlg, IDC_SPLITON), false); EnableWindow(GetDlgItem(hDlg, IDC_SPLITOFF), false); - BYTE sha[64]; int len; mir_exp->rsa_get_keyhash(CPP_MODE_RSA, nullptr, nullptr, (PBYTE)&sha, &len); + BYTE sha[64]; int len; mir_exp->rsa_get_keyhash(CPP_MODE_RSA, nullptr, nullptr, (uint8_t*)&sha, &len); LPSTR txt = mir_strdup(to_hex(sha, len)); SetDlgItemText(hDlg, IDC_RSA_SHA, txt); mir_free(txt); diff --git a/plugins/SecureIM/src/svcs_rsa.cpp b/plugins/SecureIM/src/svcs_rsa.cpp index 7518761418..dac6992713 100644 --- a/plugins/SecureIM/src/svcs_rsa.cpp +++ b/plugins/SecureIM/src/svcs_rsa.cpp @@ -28,7 +28,7 @@ int __cdecl rsa_inject(HANDLE context, LPCSTR msg) #define MSGSIZE 1024 -int __cdecl rsa_check_pub(HANDLE context, PBYTE pub, int pubLen, PBYTE sig, int sigLen) +int __cdecl rsa_check_pub(HANDLE context, uint8_t *pub, int pubLen, PBYTE sig, int sigLen) { int v = 0, k = 0; pUinKey ptr = getUinCtx(context); if (!ptr) return 0; @@ -44,8 +44,8 @@ int __cdecl rsa_check_pub(HANDLE context, PBYTE pub, int pubLen, PBYTE sig, int dbv.type = DBVT_BLOB; if (db_get(ptr->hContact, MODULENAME, "rsa_pub", &dbv) == 0) { k = 1; - PBYTE buf = (PBYTE)alloca(sigLen); int len; - mir_exp->rsa_get_hash((PBYTE)dbv.pbVal, dbv.cpbVal, (PBYTE)buf, &len); + uint8_t *buf = (uint8_t*)alloca(sigLen); int len; + mir_exp->rsa_get_hash((uint8_t*)dbv.pbVal, dbv.cpbVal, (uint8_t*)buf, &len); sha_old = mir_strdup(to_hex(buf, len)); db_free(&dbv); } @@ -153,7 +153,7 @@ void sttGenerateRSA(LPVOID) char pub_key[4096]; int pub_len; mir_exp->rsa_gen_keypair(CPP_MODE_RSA_4096); - mir_exp->rsa_get_keypair(CPP_MODE_RSA_4096, (PBYTE)&priv_key, &priv_len, (PBYTE)&pub_key, &pub_len); + mir_exp->rsa_get_keypair(CPP_MODE_RSA_4096, (uint8_t*)&priv_key, &priv_len, (uint8_t*)&pub_key, &pub_len); db_set_blob(0, MODULENAME, "rsa_priv", priv_key, priv_len); db_set_blob(0, MODULENAME, "rsa_pub", pub_key, pub_len); diff --git a/plugins/SecureIM/src/svcs_rsa.h b/plugins/SecureIM/src/svcs_rsa.h index f076d3bd8b..c6c84e4c20 100644 --- a/plugins/SecureIM/src/svcs_rsa.h +++ b/plugins/SecureIM/src/svcs_rsa.h @@ -5,9 +5,9 @@ extern pRSA_EXPORT mir_exp; extern RSA_IMPORT imp; extern BOOL rsa_4096; -int __cdecl rsa_inject(HANDLE,LPCSTR); -int __cdecl rsa_check_pub(HANDLE,PBYTE,int,PBYTE,int); -void __cdecl rsa_notify(HANDLE,int); +int __cdecl rsa_inject(HANDLE, LPCSTR); +int __cdecl rsa_check_pub(HANDLE, uint8_t*, int, uint8_t*, int); +void __cdecl rsa_notify(HANDLE, int); void sttGenerateRSA(LPVOID); BYTE loadRSAkey(pUinKey); diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index d241ac65ae..b57405b173 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -352,7 +352,7 @@ void CSend::DB_EventAdd(WORD EventType) dbei.timestamp = time(0); dbei.flags |= DBEF_UTF; dbei.cbBlob = m_cbEventMsg; - dbei.pBlob = (PBYTE)m_szEventMsg.GetString(); + dbei.pBlob = (uint8_t*)m_szEventMsg.GetString(); db_event_add(m_hContact, &dbei); } diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp index 0de062e3fa..3d5f1b7d0b 100644 --- a/plugins/ShellExt/src/main.cpp +++ b/plugins/ShellExt/src/main.cpp @@ -189,7 +189,7 @@ STDAPI DllRegisterServer() GetModuleFileName(g_plugin.getInst(), tszFileName, _countof(tszFileName)); if (RegSetValueEx(kInprocServer, nullptr, 0, REG_SZ, (LPBYTE)tszFileName, sizeof(wchar_t) * (lstrlen(tszFileName) + 1))) return E_FAIL; - if (RegSetValueExA(kInprocServer, "ThreadingModel", 0, REG_SZ, (PBYTE)str4, sizeof(str4))) + if (RegSetValueExA(kInprocServer, "ThreadingModel", 0, REG_SZ, (uint8_t*)str4, sizeof(str4))) return E_FAIL; ////////////////////////////////////////////////////////////////////////////////////// @@ -204,7 +204,7 @@ STDAPI DllRegisterServer() HRegKey k2(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"); if (k2 == nullptr) return E_FAIL; - if (RegSetValueExA(k2, str2, 0, REG_SZ, (PBYTE)str1, str1len)) + if (RegSetValueExA(k2, str2, 0, REG_SZ, (uint8_t*)str1, str1len)) return E_FAIL; return S_OK; diff --git a/plugins/ShellExt/src/shlext.cpp b/plugins/ShellExt/src/shlext.cpp index 20036fb699..51b1895a8e 100644 --- a/plugins/ShellExt/src/shlext.cpp +++ b/plugins/ShellExt/src/shlext.cpp @@ -535,7 +535,7 @@ static void BuildSkinIcons(TEnumData * lParam) if (pct->cbSize != sizeof(TSlotIPC) || pct->fType != REQUEST_NEWICONS) break; - TSlotProtoIcons * p = (TSlotProtoIcons*)(PBYTE(pct) + sizeof(TSlotIPC)); + TSlotProtoIcons * p = (TSlotProtoIcons*)((uint8_t*)pct + sizeof(TSlotIPC)); Self->ProtoIcons = (TSlotProtoIcons*)realloc(Self->ProtoIcons, (Self->ProtoIconsCount + 1) * sizeof(TSlotProtoIcons)); TSlotProtoIcons * d = &Self->ProtoIcons[Self->ProtoIconsCount]; memmove(d, p, sizeof(TSlotProtoIcons)); diff --git a/plugins/ShellExt/src/shlicons.cpp b/plugins/ShellExt/src/shlicons.cpp index 1c6b2dbcb6..d8337318ab 100644 --- a/plugins/ShellExt/src/shlicons.cpp +++ b/plugins/ShellExt/src/shlicons.cpp @@ -55,7 +55,7 @@ HBITMAP ARGB_BitmapFromIcon(IWICImagingFactory* Factory, HDC hDC, HICON hIcon) UINT cbStride = cx * sizeof(DWORD); // ARGB = DWORD UINT cbBuffer = cy * cbStride; // note: the pbBuffer memory is owned by the DIB and will be freed when the bitmap is released - hr = bitmap->CopyPixels(nullptr, cbStride, cbBuffer, (PBYTE)pbBuffer); + hr = bitmap->CopyPixels(nullptr, cbStride, cbBuffer, (uint8_t*)pbBuffer); if (hr != S_OK) { // the copy failed, delete the DIB DeleteObject(hBmp); diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 6e892f2314..03508b3259 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -209,7 +209,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) dbei.szModule = pszProto; dbei.timestamp = time(0); dbei.cbBlob = (int)mir_strlen(pszUtf) + 1; - dbei.pBlob = (PBYTE)pszUtf; + dbei.pBlob = (uint8_t*)pszUtf; db_event_add(hContact, &dbei); mir_free(ptszTemp2); diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp index f61f1c43f5..d155dcd097 100644 --- a/plugins/Spamotron/src/spamotron.cpp +++ b/plugins/Spamotron/src/spamotron.cpp @@ -426,7 +426,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) if (g_plugin.getByte("KeepBlockedMsg", defaultKeepBlockedMsg)) { if (dbei->eventType == EVENTTYPE_AUTHREQUEST) { // Save the request to database so that it can be automatically submitted on user approval - PBYTE eventdata = (PBYTE)malloc(sizeof(DWORD) + dbei->cbBlob); + uint8_t *eventdata = (uint8_t*)malloc(sizeof(DWORD) + dbei->cbBlob); if (eventdata != nullptr && dbei->cbBlob > 0) { memcpy(eventdata, &dbei->cbBlob, sizeof(DWORD)); memcpy(eventdata + sizeof(DWORD), dbei->pBlob, dbei->cbBlob); @@ -440,11 +440,11 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) if (g_plugin.getByte("MarkMsgUnreadOnApproval", defaultMarkMsgUnreadOnApproval)) { DBVARIANT _dbv; DWORD dbei_size = 3 * sizeof(DWORD) + sizeof(WORD) + dbei->cbBlob + (DWORD)mir_strlen(dbei->szModule) + 1; - PBYTE eventdata = (PBYTE)malloc(dbei_size); - PBYTE pos = eventdata; + uint8_t *eventdata = (uint8_t*)malloc(dbei_size); + uint8_t *pos = eventdata; if (eventdata != nullptr && dbei->cbBlob > 0) { if (db_get(hContact, MODULENAME, "LastMsgEvents", &_dbv) == 0) { - eventdata = (PBYTE)realloc(eventdata, dbei_size + _dbv.cpbVal); + eventdata = (uint8_t*)realloc(eventdata, dbei_size + _dbv.cpbVal); pos = eventdata; memcpy(eventdata, _dbv.pbVal, _dbv.cpbVal); pos += _dbv.cpbVal; diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp index 52ba7ef5c4..d34d7ee5f7 100644 --- a/plugins/Spamotron/src/utils.cpp +++ b/plugins/Spamotron/src/utils.cpp @@ -465,7 +465,7 @@ int LogToSystemHistory(char *message, char *origmessage) DBEVENTINFO dbei = {}; dbei.timestamp = time(&tm); dbei.szModule = MODULENAME; - dbei.pBlob = (PBYTE)msg; + dbei.pBlob = (uint8_t*)msg; if (origmessage) dbei.cbBlob = (1 + mir_snprintf(msg, "%s: %s%s %s: %s", MODULENAME, message, DOT(message), Translate("Their message was"), origmessage)); else @@ -480,7 +480,7 @@ void MarkUnread(MCONTACT hContact) { // We're not actually marking anything. We just pushing saved events to the database from a temporary location DBVARIANT _dbv = {0}; - PBYTE pos; + uint8_t *pos; if (hContact == NULL) return; @@ -498,7 +498,7 @@ void MarkUnread(MCONTACT hContact) pos += mir_strlen((const char*)pos)+1; memcpy(&dbei.cbBlob, pos, sizeof(DWORD)); pos += sizeof(DWORD); - dbei.pBlob = (PBYTE)malloc(dbei.cbBlob); + dbei.pBlob = (uint8_t*)malloc(dbei.cbBlob); memcpy(dbei.pBlob, pos, dbei.cbBlob); pos += dbei.cbBlob; db_event_add(hContact,&dbei); diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index 3ea1c7736b..6197b79b35 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -319,7 +319,7 @@ void HistoryLog(MCONTACT hContact, char *data, int event_type, int flags) Event.flags = flags | DBEF_UTF; Event.timestamp = (DWORD)time(0); Event.cbBlob = (DWORD)mir_strlen(data) + 1; - Event.pBlob = (PBYTE)_strdup(data); + Event.pBlob = (uint8_t*)_strdup(data); db_event_add(hContact, &Event); } diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index ca14910848..150faf6c00 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -529,7 +529,7 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) T2Utf szMsg(text); DBEVENTINFO dbei = {}; - dbei.pBlob = (PBYTE)(char*)szMsg; + dbei.pBlob = (uint8_t*)(char*)szMsg; dbei.cbBlob = (int)mir_strlen(szMsg) + 1; dbei.flags = DBEF_UTF | DBEF_READ; dbei.eventType = EVENTTYPE_STATUSCHANGE; diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index c850592ec7..ed73a491b9 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -58,7 +58,7 @@ struct CSendLaterJob : public MZeroedObject time_t created; // job was created at this time (important to kill jobs, that are too old) time_t lastSent; // time at which the delivery was initiated. used to handle timeouts char *sendBuffer; // utf-8 send buffer - PBYTE pBuf; // conventional send buffer (for non-utf8 protocols) + uint8_t *pBuf; // conventional send buffer (for non-utf8 protocols) DWORD dwFlags; int iSendCount; // # of times we tried to send it... bool fSuccess, fFailed; @@ -731,7 +731,7 @@ int SendLater::addJob(const char *szSetting, void *lParam) if (szWchar) required += (mir_wstrlen(szWchar) + 1) * sizeof(wchar_t); - job->pBuf = (PBYTE)mir_calloc(required); + job->pBuf = (uint8_t*)mir_calloc(required); strncpy((char*)job->pBuf, szAnsi, iLen); job->pBuf[iLen] = 0; @@ -793,7 +793,7 @@ HANDLE SendLater::processAck(const ACKDATA *ack) dbei.szModule = Proto_GetBaseAccountName((p->hContact)); dbei.timestamp = time(0); dbei.cbBlob = (int)mir_strlen(p->sendBuffer) + 1; - dbei.pBlob = (PBYTE)(p->sendBuffer); + dbei.pBlob = (uint8_t*)(p->sendBuffer); db_event_add(p->hContact, &dbei); p->cleanDB(); diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index d84e158d22..cb52ecc8a8 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -471,7 +471,7 @@ int SendQueue::ackMessage(CMsgDialog *dat, WPARAM wParam, LPARAM lParam) if (job.dwFlags & PREF_RTL) dbei.flags |= DBEF_RTL; - dbei.pBlob = (PBYTE)job.szSendBuffer; + dbei.pBlob = (uint8_t*)job.szSendBuffer; dbei.szId = (char *)ack->lParam; MessageWindowEvent evt = { job.iSendId, job.hContact, &dbei }; @@ -550,7 +550,7 @@ int SendQueue::doSendLater(int iJobIndex, CMsgDialog *dat, MCONTACT hContact, bo dbei.szModule = Proto_GetBaseAccountName(dat->m_hContact); dbei.timestamp = time(0); dbei.cbBlob = (int)mir_strlen(utfText) + 1; - dbei.pBlob = (PBYTE)(char*)utfText; + dbei.pBlob = (uint8_t*)(char*)utfText; dat->LogEvent(dbei); if (dat->m_hDbEventFirst == 0) diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h index b99e28d3b5..c681198129 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h @@ -56,7 +56,7 @@ public: __inline void uid(BYTE val) { _dbvUID.type = DBVT_BYTE; _dbvUID.bVal = val; } __inline void uid(WORD val) { _dbvUID.type = DBVT_WORD; _dbvUID.wVal = val; } __inline void uid(DWORD val) { _dbvUID.type = DBVT_DWORD; _dbvUID.dVal = val; } - __inline void uidn(PBYTE val, DWORD len) { _dbvUID.type = DBVT_BLOB; _dbvUID.pbVal = val; _dbvUID.cpbVal = (WORD)len; } + __inline void uidn(uint8_t *val, DWORD len) { _dbvUID.type = DBVT_BLOB; _dbvUID.pbVal = val; _dbvUID.cpbVal = (WORD)len; } __inline void uida(LPCSTR val) { _dbvUID.type = (_dbvUID.pszVal = mir_utf8decodeA(val)) ? DBVT_ASCIIZ : DBVT_DELETED; diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index bc50caf32e..3bc587b868 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -543,7 +543,7 @@ int CExImContactXML::LoadXmlElement(const TiXmlElement *xContact) case 'n': size_t valLen; { - PBYTE pbVal = (PBYTE)mir_base64_decode(pUID, &valLen); + uint8_t *pbVal = (uint8_t*)mir_base64_decode(pUID, &valLen); if (pbVal != nullptr) uidn(pbVal, (DWORD)valLen); } @@ -866,7 +866,7 @@ int CExImContactXML::ImportSetting(LPCSTR pszModule, const TiXmlElement *xmlEntr break; case 'n': dbv.type = DBVT_BLOB; - dbv.pbVal = (PBYTE)mir_base64_decode(value + 1, &baselen); + dbv.pbVal = (uint8_t*)mir_base64_decode(value + 1, &baselen); if (dbv.pbVal != nullptr) dbv.cpbVal = (WORD)baselen; else { @@ -924,7 +924,7 @@ int CExImContactXML::ImportEvent(LPCSTR pszModule, const TiXmlElement *xmlEvent) return ERROR_INVALID_VALUE; size_t baselen; - mir_ptr tmpVal((PBYTE)mir_base64_decode(tmp, &baselen)); + mir_ptr tmpVal((uint8_t*)mir_base64_decode(tmp, &baselen)); if (tmpVal != NULL) { // event owning module dbei.pBlob = tmpVal; diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp index 11e97c3862..29d48a95b5 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp @@ -55,20 +55,20 @@ static void InitAlteredPlacesBar() CHAR szProfilePath[MAX_PATH]; // default places: Desktop, My Documents, My Computer - dwFolderID = 0; RegSetValueEx(hkPlacesBar, L"Place0", 0, REG_DWORD, (PBYTE)&dwFolderID, sizeof(DWORD)); - dwFolderID = 5; RegSetValueEx(hkPlacesBar, L"Place1", 0, REG_DWORD, (PBYTE)&dwFolderID, sizeof(DWORD)); - dwFolderID = 17; RegSetValueEx(hkPlacesBar, L"Place2", 0, REG_DWORD, (PBYTE)&dwFolderID, sizeof(DWORD)); + dwFolderID = 0; RegSetValueEx(hkPlacesBar, L"Place0", 0, REG_DWORD, (uint8_t*)&dwFolderID, sizeof(DWORD)); + dwFolderID = 5; RegSetValueEx(hkPlacesBar, L"Place1", 0, REG_DWORD, (uint8_t*)&dwFolderID, sizeof(DWORD)); + dwFolderID = 17; RegSetValueEx(hkPlacesBar, L"Place2", 0, REG_DWORD, (uint8_t*)&dwFolderID, sizeof(DWORD)); // Miranda's installation path GetModuleFileNameA(GetModuleHandleA("mir_app.mir"), szMirandaPath, _countof(szMirandaPath)); p = mir_strrchr(szMirandaPath, '\\'); if (p) - RegSetValueExA(hkPlacesBar, "Place3", 0, REG_SZ, (PBYTE)szMirandaPath, (p - szMirandaPath) + 1); + RegSetValueExA(hkPlacesBar, "Place3", 0, REG_SZ, (uint8_t*)szMirandaPath, (p - szMirandaPath) + 1); // Miranda's profile path if (!Profile_GetPathA(_countof(szProfilePath), szProfilePath)) { // only add if different from profile path - RegSetValueExA(hkPlacesBar, "Place4", 0, REG_SZ, (PBYTE)szProfilePath, (DWORD)mir_strlen(szProfilePath) + 1); + RegSetValueExA(hkPlacesBar, "Place4", 0, REG_SZ, (uint8_t*)szProfilePath, (DWORD)mir_strlen(szProfilePath) + 1); } RegCloseKey(hkPlacesBar); diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp index a83438b9ad..b19edc5a4f 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp @@ -365,10 +365,10 @@ int ImportSetting(MCONTACT hContact, LPCSTR pszModule, LPSTR &strLine) case 'n': case 'N': - PBYTE dest; + uint8_t *dest; dbv.type = DBVT_BLOB; dbv.cpbVal = (WORD)mir_strlen(value) / 3; - dbv.pbVal = (PBYTE)value; + dbv.pbVal = (uint8_t*)value; for (dest = dbv.pbVal, value = strtok(value, " "); value && *value; value = strtok(nullptr, " ")) diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp index 17cb4a180f..8a7eff65c8 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp @@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. BYTE IsUSASCII(LPCSTR pBuffer, LPDWORD pcbBuffer) { BYTE c; - PBYTE s = (PBYTE)pBuffer; + uint8_t *s = (uint8_t*)pBuffer; BYTE bIsUTF = 0; if (s == nullptr) return 1; @@ -49,7 +49,7 @@ BYTE IsUSASCII(LPCSTR pBuffer, LPDWORD pcbBuffer) if (!pcbBuffer) return 0; bIsUTF = 1; } - if (pcbBuffer) *pcbBuffer = s - (PBYTE)pBuffer; + if (pcbBuffer) *pcbBuffer = s - (uint8_t*)pBuffer; return !bIsUTF; } @@ -100,7 +100,7 @@ CLineBuffer::~CLineBuffer() BYTE CLineBuffer::_resizeBuf(const size_t cbReq) { if (cbReq > _cbVal - _cbUsed) { - if (!(_pVal = (PBYTE)mir_realloc(_pVal, BLOCKSIZE + _cbVal + 1))) { + if (!(_pVal = (uint8_t*)mir_realloc(_pVal, BLOCKSIZE + _cbVal + 1))) { _cbVal = 0; _cbUsed = 0; return FALSE; @@ -404,7 +404,7 @@ void CLineBuffer::fput(FILE *outfile) void CLineBuffer::fputEncoded(FILE *outFile) { - PBYTE pVal = _pVal; + uint8_t *pVal = _pVal; if (pVal && _cbUsed > 0) { _pVal[_cbUsed] = 0; @@ -507,7 +507,7 @@ int CLineBuffer::fgetEncoded(FILE *inFile) size_t CLineBuffer::GetTokenFirst(const CHAR delim, CLineBuffer *pBuf) { - PBYTE here; + uint8_t *here; size_t wLength; _pTok = _pVal; @@ -543,7 +543,7 @@ size_t CLineBuffer::GetTokenFirst(const CHAR delim, CLineBuffer *pBuf) size_t CLineBuffer::GetTokenNext(const CHAR delim, CLineBuffer *pBuf) { - PBYTE here; + uint8_t *here; size_t wLength; if (!_pTok || !*_pTok) @@ -581,7 +581,7 @@ size_t CLineBuffer::GetTokenNext(const CHAR delim, CLineBuffer *pBuf) int CLineBuffer::DBWriteTokenFirst(MCONTACT hContact, const CHAR *pszModule, const CHAR *pszSetting, const CHAR delim) { - PBYTE here; + uint8_t *here; int iRet = 1; _pTok = _pVal; @@ -619,7 +619,7 @@ int CLineBuffer::DBWriteTokenFirst(MCONTACT hContact, const CHAR *pszModule, con int CLineBuffer::DBWriteTokenNext(MCONTACT hContact, const CHAR *pszModule, const CHAR *pszSetting, const CHAR delim) { - PBYTE here; + uint8_t *here; int iRet = 1; if (_pTok && *_pTok) { diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h index cea4cc9067..090308b5fd 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h @@ -24,8 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class CLineBuffer { private: - PBYTE _pVal; - PBYTE _pTok; + uint8_t *_pVal; + uint8_t *_pTok; size_t _cbVal; size_t _cbUsed; diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index cb69877cfb..30ea296ae7 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -536,7 +536,7 @@ bool GetInfoWithData(MEVENT hEvent, DBEVENTINFO *dbei) dbei->cbBlob = (size != -1) ? (DWORD)size : 0; } if (dbei->cbBlob) { - dbei->pBlob = (PBYTE) mir_alloc(dbei->cbBlob); + dbei->pBlob = (uint8_t*) mir_alloc(dbei->cbBlob); if (dbei->pBlob == nullptr) dbei->cbBlob = 0; } diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index b5d3ebaab9..813b24af56 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -453,11 +453,11 @@ public: class CContactUpdater : public CContactQueue { - CUpdProgress* _pProgress; // pointer to the progress dialog/popup - HANDLE _hProtoAckEvent; // handle to protocol ack notification - MCONTACT _hContact; // current contact being refreshed - PBYTE _hContactAcks; // array of acknoledgements for the current contact to wait for - INT_PTR _nContactAcks; // number of acknoledgements for the current contact to wait for + CUpdProgress *_pProgress; // pointer to the progress dialog/popup + HANDLE _hProtoAckEvent; // handle to protocol ack notification + MCONTACT _hContact; // current contact being refreshed + uint8_t *_hContactAcks; // array of acknoledgements for the current contact to wait for + INT_PTR _nContactAcks; // number of acknoledgements for the current contact to wait for MIRANDA_CPP_PLUGIN_API(CContactUpdater); @@ -518,7 +518,7 @@ class CContactUpdater : public CContactQueue if (ack->hProcess || ack->lParam) { if (!_hContactAcks) { _nContactAcks = (INT_PTR)ack->hProcess; - _hContactAcks = (PBYTE)mir_calloc(sizeof(BYTE) * (INT_PTR)ack->hProcess); + _hContactAcks = (uint8_t*)mir_calloc(sizeof(BYTE) * (INT_PTR)ack->hProcess); } if (ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED) diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp index 38a00e8d83..ded98ec659 100644 --- a/plugins/Variables/src/parse_system.cpp +++ b/plugins/Variables/src/parse_system.cpp @@ -612,7 +612,7 @@ static wchar_t* parseTextFile(ARGUMENTSINFO *ai) if (*ai->argv.w[2] == '0') { // complete file bufSz = fileSz + csz; - pBuf = (PBYTE)mir_calloc(bufSz); + pBuf = (uint8_t*)mir_calloc(bufSz); if (pBuf == nullptr) { CloseHandle(hFile); return nullptr; @@ -636,7 +636,7 @@ static wchar_t* parseTextFile(ARGUMENTSINFO *ai) return res; } bufSz = TXTFILEBUFSZ*csz; - pBuf = (PBYTE)mir_calloc(bufSz); + pBuf = (uint8_t*)mir_calloc(bufSz); if (pBuf == nullptr) { CloseHandle(hFile); return nullptr; @@ -770,7 +770,7 @@ static wchar_t* parseTextFile(ARGUMENTSINFO *ai) pCur -= csz; } icur = pCur - pBuf; - pBuf = (PBYTE)mir_realloc(pBuf, bufSz); + pBuf = (uint8_t*)mir_realloc(pBuf, bufSz); pCur = pBuf + icur; memset((pCur + 1), 0, (TXTFILEBUFSZ * csz)); } diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp index 9a5cd03e16..247d226d7e 100644 --- a/plugins/WhenWasIt/src/utils.cpp +++ b/plugins/WhenWasIt/src/utils.cpp @@ -73,7 +73,7 @@ int Info(char *title, char *format, ...) #define HEX_SIZE 8 -char* BinToHex(int size, PBYTE data) +char* BinToHex(int size, uint8_t *data) { char *szresult = nullptr; char buffer[32] = { 0 }; //should be more than enough diff --git a/plugins/WhenWasIt/src/utils.h b/plugins/WhenWasIt/src/utils.h index 912b5ceeb7..9a5c65a1d9 100644 --- a/plugins/WhenWasIt/src/utils.h +++ b/plugins/WhenWasIt/src/utils.h @@ -35,8 +35,8 @@ int LogInit(); int Log(char *format, ...); int Info(char *title, char *format, ...); -char *BinToHex(int size, PBYTE data); -void HexToBin(char *inData, ULONG &size, PBYTE &outData); +char *BinToHex(int size, uint8_t *data); +void HexToBin(char *inData, ULONG &size, uint8_t *&outData); void ScreenToClient(HWND hWnd, LPRECT rect); void AnchorMoveWindow(HWND window, const WINDOWPOS *parentPos, int anchors); diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp index 5abc1cbc44..33265400a3 100644 --- a/plugins/YARelay/src/main.cpp +++ b/plugins/YARelay/src/main.cpp @@ -69,7 +69,7 @@ int ProtoAck(WPARAM,LPARAM lparam) dbei.flags = DBEF_SENT | DBEF_UTF; dbei.eventType = EVENTTYPE_MESSAGE; dbei.cbBlob = (DWORD)mir_strlen(p->msgText) + 1; - dbei.pBlob = (PBYTE)p->msgText; + dbei.pBlob = (uint8_t*)p->msgText; db_event_add(hForwardTo, &dbei); } diff --git a/protocols/CloudFile/src/utils.cpp b/protocols/CloudFile/src/utils.cpp index d0cc60e963..8ddaafaf04 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, WORD type, DWORD flags, DWORD cbBlob, PBYTE pBlob) +MEVENT AddEventToDb(MCONTACT hContact, WORD type, DWORD flags, DWORD 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), (PBYTE)message); + AddEventToDb(hContact, EVENTTYPE_MESSAGE, DBEF_UTF | DBEF_SENT, (DWORD)mir_strlen(message), (uint8_t*)message); } void PasteToInputArea(MCONTACT hContact, const wchar_t *data) diff --git a/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp b/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp index 6055481181..5cf1ab001d 100644 --- a/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp +++ b/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp @@ -409,7 +409,7 @@ void log_to_history(const ICurrencyRatesProvider *pProvider, MCONTACT hContact, dbei.flags = DBEF_READ | DBEF_UTF; dbei.eventType = EVENTTYPE_MESSAGE; dbei.cbBlob = (int)::mir_strlen(psz) + 1; - dbei.pBlob = (PBYTE)(char*)psz; + dbei.pBlob = (uint8_t*)(char*)psz; db_event_add(hContact, &dbei); } diff --git a/protocols/CurrencyRates/src/ImportExport.cpp b/protocols/CurrencyRates/src/ImportExport.cpp index ff6408d476..f21843f1f3 100644 --- a/protocols/CurrencyRates/src/ImportExport.cpp +++ b/protocols/CurrencyRates/src/ImportExport.cpp @@ -316,7 +316,7 @@ bool handle_module(MCONTACT hContact, const TiXmlElement *pXmlModule) } else if (!mir_strcmpi(g_szXmlTypeBlob, sType)) { size_t bufLen; - mir_ptr buf((PBYTE)mir_base64_decode(sValue, &bufLen)); + mir_ptr buf((uint8_t*)mir_base64_decode(sValue, &bufLen)); if (buf) { dbs.value.pbVal = buf; dbs.value.cpbVal = (WORD)bufLen; diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp index 2b4882ed37..91c573d4db 100644 --- a/protocols/Discord/src/server.cpp +++ b/protocols/Discord/src/server.cpp @@ -109,7 +109,7 @@ void CDiscordProto::OnReceiveHistory(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest ptrA szBody(mir_utf8encodeW(wszText)); dbei.timestamp = dwTimeStamp; - dbei.pBlob = (PBYTE)szBody.get(); + dbei.pBlob = (uint8_t*)szBody.get(); dbei.cbBlob = (DWORD)mir_strlen(szBody); bool bSucceeded = false; diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index 961d5c2124..e88cd65b65 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -329,7 +329,7 @@ void CMLan::RecvMessageUrl(CCSDATA *ccs) dbei.timestamp = pre->timestamp; dbei.flags = DBEF_UTF + ((pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0); dbei.cbBlob = (DWORD)mir_strlen(szMessage) + 1; - dbei.pBlob = (PBYTE)szMessage.get(); + dbei.pBlob = (uint8_t*)szMessage.get(); db_event_add(ccs->hContact, &dbei); } @@ -913,7 +913,7 @@ void CMLan::RecvFile(CCSDATA *ccs) 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.pBlob = (PBYTE)pre->szMessage; + dbei.pBlob = (uint8_t*)pre->szMessage; db_event_add(ccs->hContact, &dbei); } diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 08649d5ac0..a60c72dade 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -908,7 +908,7 @@ retry: dbei.flags = DBEF_SENT | DBEF_UTF; dbei.eventType = EVENTTYPE_MESSAGE; dbei.cbBlob = (DWORD)mir_strlen(e->event.multilogon_msg.message) + 1; - dbei.pBlob = (PBYTE)e->event.multilogon_msg.message; + dbei.pBlob = (uint8_t*)e->event.multilogon_msg.message; db_event_add(getcontact(e->event.multilogon_msg.sender, 1, 0, nullptr), &dbei); } break; diff --git a/protocols/GmailNotifier/src/notify.cpp b/protocols/GmailNotifier/src/notify.cpp index 2413c58023..c09988f12f 100644 --- a/protocols/GmailNotifier/src/notify.cpp +++ b/protocols/GmailNotifier/src/notify.cpp @@ -150,7 +150,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.pBlob = (PBYTE)prst->content; + dbei.pBlob = (uint8_t*)prst->content; db_event_add(curAcc->hContact, &dbei); prst = prst->next; } diff --git a/protocols/ICQCorp/src/services.cpp b/protocols/ICQCorp/src/services.cpp index 908c078c35..01cf703d8f 100644 --- a/protocols/ICQCorp/src/services.cpp +++ b/protocols/ICQCorp/src/services.cpp @@ -202,7 +202,7 @@ static INT_PTR icqRecvMessage(WPARAM, LPARAM lParam) dbei.flags |= DBEF_READ; dbei.eventType = EVENTTYPE_MESSAGE; dbei.cbBlob = (DWORD)mir_strlen(szMsg) + 1; - dbei.pBlob = (PBYTE)szMsg.get(); + dbei.pBlob = (uint8_t*)szMsg.get(); db_event_add(ccs->hContact, &dbei); return 0; } @@ -374,7 +374,7 @@ static INT_PTR icqRecvFile(WPARAM, LPARAM lParam) 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.pBlob = (PBYTE)pre->szMessage; + dbei.pBlob = (uint8_t*)pre->szMessage; db_event_add(ccs->hContact, &dbei); return 0; diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 80159a7eb5..70eddc919a 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -228,7 +228,7 @@ int CIrcProto::AddOutgoingMessageToDB(MCONTACT hContact, const wchar_t *msg) dbei.eventType = EVENTTYPE_MESSAGE; dbei.timestamp = (DWORD)time(0); dbei.flags = DBEF_SENT | DBEF_UTF; - dbei.pBlob = (PBYTE)mir_utf8encodeW(S); + dbei.pBlob = (uint8_t*)mir_utf8encodeW(S); dbei.cbBlob = (DWORD)mir_strlen((char*)dbei.pBlob) + 1; db_event_add(hContact, &dbei); mir_free(dbei.pBlob); diff --git a/protocols/NewsAggregator/Src/CheckFeed.cpp b/protocols/NewsAggregator/Src/CheckFeed.cpp index eab3be7bb3..5f02986f3e 100644 --- a/protocols/NewsAggregator/Src/CheckFeed.cpp +++ b/protocols/NewsAggregator/Src/CheckFeed.cpp @@ -166,7 +166,7 @@ static void XmlToMsg(MCONTACT hContact, CMStringW &title, CMStringW &link, CMStr while (MEVENT hDbEvent = pCursor.FetchNext()) { olddbei.cbBlob = db_event_getBlobSize(hDbEvent); if (olddbei.cbBlob > cbMemoLen) - pbBuffer = (PBYTE)mir_realloc(pbBuffer, (size_t)(cbMemoLen = olddbei.cbBlob)); + pbBuffer = (uint8_t*)mir_realloc(pbBuffer, (size_t)(cbMemoLen = olddbei.cbBlob)); olddbei.pBlob = pbBuffer; db_event_get(hDbEvent, &olddbei); diff --git a/protocols/SkypeWeb/src/requests/avatars.h b/protocols/SkypeWeb/src/requests/avatars.h index 5c69ab66e2..4900d4ceef 100644 --- a/protocols/SkypeWeb/src/requests/avatars.h +++ b/protocols/SkypeWeb/src/requests/avatars.h @@ -30,7 +30,7 @@ struct GetAvatarRequest : public AsyncHttpRequest struct SetAvatarRequest : public AsyncHttpRequest { - SetAvatarRequest(const PBYTE data, size_t dataSize, const char *szMime, CSkypeProto *ppro) : + SetAvatarRequest(const uint8_t *data, size_t dataSize, const char *szMime, CSkypeProto *ppro) : AsyncHttpRequest(REQUEST_PUT, HOST_API, 0, &CSkypeProto::OnSentAvatar) { m_szUrl.AppendFormat("/users/%s/profile/avatar", ppro->m_szSkypename.MakeLower().c_str()); diff --git a/protocols/SkypeWeb/src/requests/files.h b/protocols/SkypeWeb/src/requests/files.h index 0b46644c7f..9d0047bf61 100644 --- a/protocols/SkypeWeb/src/requests/files.h +++ b/protocols/SkypeWeb/src/requests/files.h @@ -28,7 +28,7 @@ struct ASMObjectCreateRequest : public AsyncHttpRequest struct ASMObjectUploadRequest : public AsyncHttpRequest { - ASMObjectUploadRequest(CSkypeProto *ppro, const char *szObject, const PBYTE data, const size_t size, CFileUploadParam *fup) : + ASMObjectUploadRequest(CSkypeProto *ppro, const char *szObject, const uint8_t *data, const size_t size, CFileUploadParam *fup) : AsyncHttpRequest(REQUEST_PUT, HOST_OTHER, 0, &CSkypeProto::OnASMObjectUploaded) { m_szUrl.AppendFormat("https://api.asm.skype.com/v1/objects/%s/content/original", szObject); diff --git a/protocols/SkypeWeb/src/skype_avatars.cpp b/protocols/SkypeWeb/src/skype_avatars.cpp index 3527817b0f..ff2a273ea3 100644 --- a/protocols/SkypeWeb/src/skype_avatars.cpp +++ b/protocols/SkypeWeb/src/skype_avatars.cpp @@ -169,7 +169,7 @@ INT_PTR CSkypeProto::SvcSetMyAvatar(WPARAM, LPARAM lParam) if (length != -1) { rewind(hFile); - mir_ptr data((PBYTE)mir_alloc(length)); + mir_ptr data((uint8_t*)mir_alloc(length)); if (data != NULL && fread(data, sizeof(BYTE), length, hFile) == length) { const char *szMime = FreeImage_GetFIFMimeType(FreeImage_GetFIFFromFilenameU(path)); diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index 4adb73e341..afca4738ae 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -44,7 +44,7 @@ MCONTACT CSkypeProto::GetContactFromAuthEvent(MEVENT hEvent) DWORD body[3]; DBEVENTINFO dbei = {}; dbei.cbBlob = sizeof(DWORD) * 2; - dbei.pBlob = (PBYTE)&body; + dbei.pBlob = (uint8_t*)&body; if (db_event_get(hEvent, &dbei)) return INVALID_CONTACT_ID; diff --git a/protocols/SkypeWeb/src/skype_db.cpp b/protocols/SkypeWeb/src/skype_db.cpp index e8ac1ab738..886f3b6ddc 100644 --- a/protocols/SkypeWeb/src/skype_db.cpp +++ b/protocols/SkypeWeb/src/skype_db.cpp @@ -94,7 +94,7 @@ void CSkypeProto::EditEvent(MCONTACT hContact, MEVENT hEvent, const CMStringW &s std::string newMsg = jMsg.write().c_str(); dbei.cbBlob = int(newMsg.size() + 1); - dbei.pBlob = (PBYTE)newMsg.c_str(); + dbei.pBlob = (uint8_t*)newMsg.c_str(); db_event_edit(hContact, hEvent, &dbei); } diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp index fa03b94a81..61cba82d86 100644 --- a/protocols/SkypeWeb/src/skype_messages.cpp +++ b/protocols/SkypeWeb/src/skype_messages.cpp @@ -222,8 +222,8 @@ void CSkypeProto::ProcessContactRecv(MCONTACT hContact, time_t timestamp, const pre.timestamp = (DWORD)timestamp; pre.szMessage = (char*)psr; - PBYTE b = (PBYTE)mir_calloc(sizeof(DWORD) + mir_strlen(szMessageId) + 1); - PBYTE pCur = b; + uint8_t *b = (uint8_t*)mir_calloc(sizeof(DWORD) + mir_strlen(szMessageId) + 1); + uint8_t *pCur = b; *((PDWORD)pCur) = nCount; pCur += sizeof(DWORD); diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index 6bc6e8e66e..c618956198 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -319,7 +319,7 @@ int CSkypeProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) 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)); - BYTE *pBlob = (PBYTE)mir_calloc(cbBlob); + BYTE *pBlob = (uint8_t*)mir_calloc(cbBlob); BYTE *pCurBlob = pBlob; for (int i = 0; i < nCount; i++) { diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 22c71fb386..7f1862408a 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -48,7 +48,7 @@ MCONTACT CSteamProto::GetContactFromAuthEvent(MEVENT hEvent) DWORD body[3]; DBEVENTINFO dbei = {}; dbei.cbBlob = sizeof(DWORD) * 2; - dbei.pBlob = (PBYTE)& body; + dbei.pBlob = (uint8_t*)& body; if (db_event_get(hEvent, &dbei)) return INVALID_CONTACT_ID; diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index d64f430891..bf0ba87a1c 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -17,7 +17,7 @@ MCONTACT CToxProto::GetContactFromAuthEvent(MEVENT hEvent) DWORD body[3]; DBEVENTINFO dbei = {}; dbei.cbBlob = sizeof(DWORD) * 2; - dbei.pBlob = (PBYTE)&body; + dbei.pBlob = (uint8_t*)&body; if (db_event_get(hEvent, &dbei)) return INVALID_CONTACT_ID; diff --git a/protocols/Tox/src/tox_messages.cpp b/protocols/Tox/src/tox_messages.cpp index 4ec181e021..306fbf9312 100644 --- a/protocols/Tox/src/tox_messages.cpp +++ b/protocols/Tox/src/tox_messages.cpp @@ -153,7 +153,7 @@ int CToxProto::OnPreCreateMessage(WPARAM, LPARAM lParam) return 0; evt->dbei->cbBlob = evt->dbei->cbBlob - 4; - PBYTE action = (PBYTE)mir_alloc(evt->dbei->cbBlob); + uint8_t *action = (uint8_t*)mir_alloc(evt->dbei->cbBlob); memcpy(action, &evt->dbei->pBlob[4], evt->dbei->cbBlob); mir_free(evt->dbei->pBlob); evt->dbei->pBlob = action; diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index 681df6dcab..e9e858ad7e 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, WORD type, DWORD timestamp, DWORD flags, PBYTE pBlob, size_t cbBlob); + MEVENT AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, uint8_t *pBlob, size_t cbBlob); }; struct CMPlugin : public ACCPROTOPLUGIN diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp index d39deee198..96e7934b2b 100644 --- a/protocols/Tox/src/tox_utils.cpp +++ b/protocols/Tox/src/tox_utils.cpp @@ -126,7 +126,7 @@ bool CToxProto::IsFileExists(const wchar_t* path) return _waccess(path, 0) == 0; } -MEVENT CToxProto::AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, PBYTE pBlob, size_t cbBlob) +MEVENT CToxProto::AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, uint8_t *pBlob, size_t cbBlob) { DBEVENTINFO dbei = {}; dbei.szModule = this->m_szModuleName; diff --git a/protocols/Twitter/src/oauth.cpp b/protocols/Twitter/src/oauth.cpp index e6c5518a61..6f8c997359 100644 --- a/protocols/Twitter/src/oauth.cpp +++ b/protocols/Twitter/src/oauth.cpp @@ -157,6 +157,6 @@ CMStringA CTwitterProto::OAuthCreateSignature(const CMStringA &signatureBase, co BYTE digest[MIR_SHA1_HASH_SIZE]; unsigned int len; - HMAC(EVP_sha1(), key.c_str(), (int)key.GetLength(), (PBYTE)signatureBase.c_str(), signatureBase.GetLength(), digest, &len); + HMAC(EVP_sha1(), key.c_str(), (int)key.GetLength(), (uint8_t*)signatureBase.c_str(), signatureBase.GetLength(), digest, &len); return CMStringA(ptrA(mir_base64_encode(digest, sizeof(digest)))); } diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 7c5f09dad5..6e6452ac70 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -623,7 +623,7 @@ MCONTACT CVkProto::MContactFromDbEvent(MEVENT hDbEvent) DWORD body[2]; DBEVENTINFO dbei = {}; dbei.cbBlob = sizeof(DWORD) * 2; - dbei.pBlob = (PBYTE)&body; + dbei.pBlob = (uint8_t*)&body; if (db_event_get(hDbEvent, &dbei)) return INVALID_CONTACT_ID; @@ -1722,7 +1722,7 @@ void CVkProto::AddVkDeactivateEvent(MCONTACT hContact, CMStringW& wszType) dbei.eventType = VK_USER_DEACTIVATE_ACTION; ptrA pszDescription(mir_utf8encode(vkDeactivateEvent[iDEIdx].szDescription)); dbei.cbBlob = (DWORD)mir_strlen(pszDescription) + 1; - dbei.pBlob = (PBYTE)mir_strdup(pszDescription); + dbei.pBlob = (uint8_t*)mir_strdup(pszDescription); dbei.flags = DBEF_UTF | ( ( m_vkOptions.bShowVkDeactivateEvents diff --git a/src/core/stdclist/src/clcpaint.cpp b/src/core/stdclist/src/clcpaint.cpp index 99d3479f74..8a493e0649 100644 --- a/src/core/stdclist/src/clcpaint.cpp +++ b/src/core/stdclist/src/clcpaint.cpp @@ -472,7 +472,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) bmih.biHeight = -clRect.bottom; bmih.biPlanes = 1; bmih.biWidth = clRect.right; - PBYTE bits = (PBYTE)malloc(4 * bmih.biWidth * -bmih.biHeight); + uint8_t *bits = (uint8_t*)malloc(4 * bmih.biWidth * -bmih.biHeight); GetDIBits(hdc, hBmpOsb, 0, clRect.bottom, bits, (BITMAPINFO *)& bmih, DIB_RGB_COLORS); COLORREF greyColour = GetSysColor(COLOR_3DFACE); diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 74456b11b0..f83af57ab7 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -124,7 +124,7 @@ static int FileEventAdded(WPARAM wParam, LPARAM lParam) DBEVENTINFO dbei = {}; dbei.cbBlob = sizeof(DWORD); - dbei.pBlob = (PBYTE)&dwSignature; + dbei.pBlob = (uint8_t*)&dwSignature; db_event_get(lParam, &dbei); if (dbei.flags & (DBEF_SENT | DBEF_READ) || dbei.eventType != EVENTTYPE_FILE || dwSignature == 0) return 0; @@ -141,7 +141,7 @@ int SRFile_GetRegValue(HKEY hKeyBase, const wchar_t *szSubKey, const wchar_t *sz if (RegOpenKeyEx(hKeyBase, szSubKey, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS) return 0; - if (RegQueryValueEx(hKey, szValue, nullptr, nullptr, (PBYTE)szOutput, &cbOut) != ERROR_SUCCESS) { + if (RegQueryValueEx(hKey, szValue, nullptr, nullptr, (uint8_t*)szOutput, &cbOut) != ERROR_SUCCESS) { RegCloseKey(hKey); return 0; } diff --git a/src/core/stdfile/src/fileexistsdlg.cpp b/src/core/stdfile/src/fileexistsdlg.cpp index b18cac040f..34e198d55a 100644 --- a/src/core/stdfile/src/fileexistsdlg.cpp +++ b/src/core/stdfile/src/fileexistsdlg.cpp @@ -60,7 +60,7 @@ static void DoAnnoyingShellCommand(HWND hwnd, const wchar_t *szFilename, int cmd IShellFolder *pFileFolder; for (pidl = pCurrentIdl;;) { - pidlNext = (ITEMIDLIST *)((PBYTE)pidl + pidl->mkid.cb); + pidlNext = (ITEMIDLIST *)((uint8_t*)pidl + pidl->mkid.cb); if (pidlNext->mkid.cb == 0) { pidlFilename = (ITEMIDLIST *)CoTaskMemAlloc(pidl->mkid.cb + sizeof(pidl->mkid.cb)); memcpy(pidlFilename, pidl, pidl->mkid.cb + sizeof(pidl->mkid.cb)); diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index cd48520cbe..1e6b22b57d 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -83,7 +83,7 @@ void FillSendData(FileDlgData *dat, DBEVENTINFO& dbei) dbei.flags |= DBEF_UTF; dbei.cbBlob = int(sizeof(DWORD) + mir_strlen(szFileNames) + mir_strlen(szMsg) + 2); - dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob); + dbei.pBlob = (uint8_t*)mir_alloc(dbei.cbBlob); *(PDWORD)dbei.pBlob = 0; mir_strcpy((char*)dbei.pBlob + sizeof(DWORD), szFileNames); mir_strcpy((char*)dbei.pBlob + sizeof(DWORD) + mir_strlen(szFileNames) + 1, szMsg); diff --git a/src/core/stdmsg/src/cmdlist.cpp b/src/core/stdmsg/src/cmdlist.cpp index b1953d8553..50c9302f36 100644 --- a/src/core/stdmsg/src/cmdlist.cpp +++ b/src/core/stdmsg/src/cmdlist.cpp @@ -94,7 +94,7 @@ void msgQueue_processack(MCONTACT hContact, int id, BOOL success, LPARAM lParam) dbei.szModule = Proto_GetBaseAccountName(hContact); dbei.timestamp = time(0); dbei.cbBlob = (DWORD)(mir_strlen(p->szMsg) + 1); - dbei.pBlob = (PBYTE)p->szMsg; + dbei.pBlob = (uint8_t*)p->szMsg; dbei.szId = (char *)lParam; MessageWindowEvent evt = { id, hContact, &dbei }; diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 7905452248..73315ce746 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -409,7 +409,7 @@ void LoadMsgLogIcons(void) HDC hdc = GetDC(nullptr); HBITMAP hBmp = CreateCompatibleBitmap(hdc, bih.biWidth, bih.biHeight); HDC hdcMem = CreateCompatibleDC(hdc); - PBYTE pBmpBits = (PBYTE)mir_alloc(widthBytes * bih.biHeight); + uint8_t *pBmpBits = (uint8_t*)mir_alloc(widthBytes * bih.biHeight); for (int i = 0; i < _countof(pLogIconBmpBits); i++) { HICON hIcon = IcoLib_GetIconByHandle(iconList[i].hIcolib); diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp index bd99a7a685..b7d7558746 100644 --- a/src/core/stduihist/src/history.cpp +++ b/src/core/stduihist/src/history.cpp @@ -304,7 +304,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP int newBlobSize = db_event_getBlobSize(hDbEvent); if (newBlobSize > oldBlobSize) { - dbei.pBlob = (PBYTE)mir_realloc(dbei.pBlob, newBlobSize); + dbei.pBlob = (uint8_t*)mir_realloc(dbei.pBlob, newBlobSize); oldBlobSize = newBlobSize; } dbei.cbBlob = oldBlobSize; diff --git a/src/mir_app/src/chat_log.cpp b/src/mir_app/src/chat_log.cpp index 86072e9ccb..33d97cc08c 100644 --- a/src/mir_app/src/chat_log.cpp +++ b/src/mir_app/src/chat_log.cpp @@ -429,7 +429,7 @@ void LoadMsgLogBitmaps(void) HDC hdc = GetDC(nullptr); HBITMAP hBmp = CreateCompatibleBitmap(hdc, bih.biWidth, bih.biHeight); HDC hdcMem = CreateCompatibleDC(hdc); - PBYTE pBmpBits = (PBYTE)mir_alloc(widthBytes * bih.biHeight); + uint8_t *pBmpBits = (uint8_t*)mir_alloc(widthBytes * bih.biHeight); for (int i = 0; i < _countof(pLogIconBmpBits); i++) { size_t size = RTFPICTHEADERMAXSIZE + (bih.biSize + widthBytes * bih.biHeight) * 2; pLogIconBmpBits[i] = (char*)mir_alloc(size); diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index a815e2732b..7d2d0b3b70 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -964,7 +964,7 @@ MIR_APP_DLL(CHAT_MANAGER*) Chat_CustomizeApi(const CHAT_MANAGER_INITDATA *pInit) return &g_chatApi; // wipe out old junk - memset(PBYTE(&g_chatApi) + offsetof(CHAT_MANAGER, OnCreateModule), 0, sizeof(CHAT_MANAGER) - offsetof(CHAT_MANAGER, OnCreateModule)); + memset((uint8_t*)&g_chatApi + offsetof(CHAT_MANAGER, OnCreateModule), 0, sizeof(CHAT_MANAGER) - offsetof(CHAT_MANAGER, OnCreateModule)); if (g_cbSession) { // reallocate old sessions mir_cslock lck(csChat); @@ -974,7 +974,7 @@ MIR_APP_DLL(CHAT_MANAGER*) Chat_CustomizeApi(const CHAT_MANAGER_INITDATA *pInit) for (auto &p : tmp) { SESSION_INFO *p1 = (SESSION_INFO*)realloc(p, pInit->cbSession); - memset(PBYTE(p1) + sizeof(SESSION_INFO), 0, pInit->cbSession - sizeof(SESSION_INFO)); + memset((uint8_t*)p1 + sizeof(SESSION_INFO), 0, pInit->cbSession - sizeof(SESSION_INFO)); g_arSessions.insert(p1); } } @@ -988,7 +988,7 @@ MIR_APP_DLL(CHAT_MANAGER*) Chat_CustomizeApi(const CHAT_MANAGER_INITDATA *pInit) for (auto &mi : tmp) { MODULEINFO *p1 = (MODULEINFO*)realloc(mi, pInit->cbModuleInfo); - memset(PBYTE(p1) + sizeof(GCModuleInfoBase), 0, pInit->cbModuleInfo - sizeof(GCModuleInfoBase)); + memset((uint8_t*)p1 + sizeof(GCModuleInfoBase), 0, pInit->cbModuleInfo - sizeof(GCModuleInfoBase)); g_arModules.insert(p1); if (p1 != mi) // realloc could change a pointer bReallocated = true; diff --git a/src/mir_app/src/db_events.cpp b/src/mir_app/src/db_events.cpp index c3d17446e5..39c48b1056 100644 --- a/src/mir_app/src/db_events.cpp +++ b/src/mir_app/src/db_events.cpp @@ -275,9 +275,9 @@ DB::AUTH_BLOB::AUTH_BLOB(MCONTACT hContact, LPCSTR nick, LPCSTR fname, LPCSTR ln m_size = uint32_t(sizeof(uint32_t) * 2 + 5 + mir_strlen(m_szNick) + mir_strlen(m_szFirstName) + mir_strlen(m_szLastName) + mir_strlen(m_szEmail) + mir_strlen(m_szReason)); } -DB::AUTH_BLOB::AUTH_BLOB(PBYTE blob) +DB::AUTH_BLOB::AUTH_BLOB(uint8_t *blob) { - PBYTE pCurBlob = blob; + uint8_t *pCurBlob = blob; m_dwUin = *(uint32_t*)pCurBlob; pCurBlob += sizeof(uint32_t); m_hContact = *(uint32_t*)pCurBlob; diff --git a/src/mir_app/src/db_ini.cpp b/src/mir_app/src/db_ini.cpp index a792640e5a..91e94fd865 100644 --- a/src/mir_app/src/db_ini.cpp +++ b/src/mir_app/src/db_ini.cpp @@ -467,7 +467,7 @@ LBL_NewLine: int len; char *pszValue, *pszEnd; - PBYTE buf = (PBYTE)mir_alloc(mir_strlen(szValue + 1)); + uint8_t *buf = (uint8_t*)mir_alloc(mir_strlen(szValue + 1)); for (len = 0, pszValue = szValue + 1;; len++) { buf[len] = (BYTE)strtol(pszValue, &pszEnd, 0x10); if (pszValue == pszEnd) diff --git a/src/mir_app/src/dll_sniffer.cpp b/src/mir_app/src/dll_sniffer.cpp index 048cba260c..2a3ecc0418 100644 --- a/src/mir_app/src/dll_sniffer.cpp +++ b/src/mir_app/src/dll_sniffer.cpp @@ -27,9 +27,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. DWORD dwVersion = 0; -static void ProcessResourcesDirectory(PIMAGE_RESOURCE_DIRECTORY pIRD, PBYTE pBase, DWORD dwType); +static void ProcessResourcesDirectory(PIMAGE_RESOURCE_DIRECTORY pIRD, uint8_t *pBase, DWORD dwType); -static void ProcessResourceEntry(PIMAGE_RESOURCE_DIRECTORY_ENTRY pIRDE, PBYTE pBase, DWORD dwType) +static void ProcessResourceEntry(PIMAGE_RESOURCE_DIRECTORY_ENTRY pIRDE, uint8_t *pBase, DWORD dwType) { if (pIRDE->DataIsDirectory) ProcessResourcesDirectory(PIMAGE_RESOURCE_DIRECTORY(pBase + pIRDE->OffsetToDirectory), pBase, dwType == 0 ? pIRDE->Name : dwType); @@ -39,7 +39,7 @@ static void ProcessResourceEntry(PIMAGE_RESOURCE_DIRECTORY_ENTRY pIRDE, PBYTE pB } } -static void ProcessResourcesDirectory(PIMAGE_RESOURCE_DIRECTORY pIRD, PBYTE pBase, DWORD dwType) +static void ProcessResourcesDirectory(PIMAGE_RESOURCE_DIRECTORY pIRD, uint8_t *pBase, DWORD dwType) { UINT i; @@ -92,7 +92,7 @@ MUUID* GetPluginInterfaces(const wchar_t *ptszFileName, bool &bIsPlugin) else __leave; - if ((PBYTE)pINTH + sizeof(IMAGE_NT_HEADERS) >= ptr + filesize) + if ((uint8_t*)pINTH + sizeof(IMAGE_NT_HEADERS) >= ptr + filesize) __leave; if (pINTH->Signature != IMAGE_NT_SIGNATURE) __leave; @@ -107,14 +107,14 @@ MUUID* GetPluginInterfaces(const wchar_t *ptszFileName, bool &bIsPlugin) if (pINTH->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 && pINTH->FileHeader.SizeOfOptionalHeader >= sizeof(IMAGE_OPTIONAL_HEADER32) && pINTH->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) { - pIDD = (PIMAGE_DATA_DIRECTORY)((PBYTE)pINTH + offsetof(IMAGE_NT_HEADERS32, OptionalHeader.DataDirectory)); - base = *(DWORD*)((PBYTE)pINTH + offsetof(IMAGE_NT_HEADERS32, OptionalHeader.ImageBase)); + pIDD = (PIMAGE_DATA_DIRECTORY)((uint8_t*)pINTH + offsetof(IMAGE_NT_HEADERS32, OptionalHeader.DataDirectory)); + base = *(DWORD*)((uint8_t*)pINTH + offsetof(IMAGE_NT_HEADERS32, OptionalHeader.ImageBase)); } else if (pINTH->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64 && pINTH->FileHeader.SizeOfOptionalHeader >= sizeof(IMAGE_OPTIONAL_HEADER64) && pINTH->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) { - pIDD = (PIMAGE_DATA_DIRECTORY)((PBYTE)pINTH + offsetof(IMAGE_NT_HEADERS64, OptionalHeader.DataDirectory)); - base = *(ULONGLONG*)((PBYTE)pINTH + offsetof(IMAGE_NT_HEADERS64, OptionalHeader.ImageBase)); + pIDD = (PIMAGE_DATA_DIRECTORY)((uint8_t*)pINTH + offsetof(IMAGE_NT_HEADERS64, OptionalHeader.DataDirectory)); + base = *(ULONGLONG*)((uint8_t*)pINTH + offsetof(IMAGE_NT_HEADERS64, OptionalHeader.ImageBase)); } else __leave; @@ -135,7 +135,7 @@ MUUID* GetPluginInterfaces(const wchar_t *ptszFileName, bool &bIsPlugin) for (DWORD idx = 0; idx < nSections; idx++) { PIMAGE_SECTION_HEADER pISH = (PIMAGE_SECTION_HEADER)(pImage + idx * sizeof(IMAGE_SECTION_HEADER)); - if (((PBYTE)pISH + sizeof(IMAGE_SECTION_HEADER) > pImage + filesize) || (pISH->PointerToRawData + pISH->SizeOfRawData > filesize)) + if (((uint8_t*)pISH + sizeof(IMAGE_SECTION_HEADER) > pImage + filesize) || (pISH->PointerToRawData + pISH->SizeOfRawData > filesize)) __leave; // process export table diff --git a/src/mir_app/src/netlib.h b/src/mir_app/src/netlib.h index c08718b5bd..d8ed8a3418 100644 --- a/src/mir_app/src/netlib.h +++ b/src/mir_app/src/netlib.h @@ -54,7 +54,7 @@ struct NetlibNestedCriticalSection struct NetlibHTTPProxyPacketQueue { NetlibHTTPProxyPacketQueue *next; - PBYTE dataBuffer; + uint8_t *dataBuffer; int dataBufferLen; }; diff --git a/src/mir_app/src/netlib_http.cpp b/src/mir_app/src/netlib_http.cpp index cea5472038..11336b7ac7 100644 --- a/src/mir_app/src/netlib_http.cpp +++ b/src/mir_app/src/netlib_http.cpp @@ -1128,7 +1128,7 @@ next: } if (bufsz > 0) { - Netlib_Dump(nlc, (PBYTE)szData, bufsz, false, dflags | MSG_NOTITLE); + Netlib_Dump(nlc, (uint8_t*)szData, bufsz, false, dflags | MSG_NOTITLE); mir_free(nlhrReply->pData); nlhrReply->pData = szData; nlhrReply->dataLength = bufsz; diff --git a/src/mir_app/src/netlib_openconn.cpp b/src/mir_app/src/netlib_openconn.cpp index 7fd4badd57..6ebd099d6c 100644 --- a/src/mir_app/src/netlib_openconn.cpp +++ b/src/mir_app/src/netlib_openconn.cpp @@ -183,7 +183,7 @@ static int NetlibInitSocks5Connection(NetlibConnection *nlc, NetlibUser *nlu, NE if (buf[1] == 2) { //rfc1929 size_t nUserLen = mir_strlen(nlu->settings.szProxyAuthUser); size_t nPassLen = mir_strlen(nlu->settings.szProxyAuthPassword); - PBYTE pAuthBuf = (PBYTE)mir_alloc(3 + nUserLen + nPassLen); + uint8_t *pAuthBuf = (uint8_t*)mir_alloc(3 + nUserLen + nPassLen); pAuthBuf[0] = 1; //auth version pAuthBuf[1] = (BYTE)nUserLen; memcpy(pAuthBuf + 2, nlu->settings.szProxyAuthUser, nUserLen); @@ -220,7 +220,7 @@ static int NetlibInitSocks5Connection(NetlibConnection *nlc, NetlibUser *nlu, NE return 0; nHostLen = 4; } - PBYTE pInit = (PBYTE)mir_alloc(6 + nHostLen); + uint8_t *pInit = (uint8_t*)mir_alloc(6 + nHostLen); pInit[0] = 5; //SOCKS5 pInit[1] = nloc->flags & NLOCF_UDP ? 3 : 1; //connect or UDP pInit[2] = 0; //reserved diff --git a/src/mir_app/src/netlib_opts.cpp b/src/mir_app/src/netlib_opts.cpp index 4c5e8f3dbe..7ae1fee706 100644 --- a/src/mir_app/src/netlib_opts.cpp +++ b/src/mir_app/src/netlib_opts.cpp @@ -167,9 +167,9 @@ static void ChangeSettingIntByCheckbox(HWND hwndDlg, UINT ctrlId, int iUser, int if (iUser == -1) { for (auto &p : tempSettings) if (!(p->flags & NUF_NOOPTIONS)) - *(int*)(((PBYTE)&p->settings) + memberOffset) = newValue; + *(int*)(((uint8_t*)&p->settings) + memberOffset) = newValue; } - else *(int*)(((PBYTE)&tempSettings[iUser]->settings) + memberOffset) = newValue; + else *(int*)(((uint8_t*)&tempSettings[iUser]->settings) + memberOffset) = newValue; SendMessage(hwndDlg, M_REFRESHENABLING, 0, 0); } @@ -181,7 +181,7 @@ static void ChangeSettingStringByEdit(HWND hwndDlg, UINT ctrlId, int iUser, int if (iUser == -1) { for (auto &p : tempSettings) { if (!(p->flags & NUF_NOOPTIONS)) { - char **ppszNew = (char**)(((PBYTE)&p->settings) + memberOffset); + char **ppszNew = (char**)(((uint8_t*)&p->settings) + memberOffset); mir_free(*ppszNew); *ppszNew = mir_strdup(szNewValue); } @@ -189,7 +189,7 @@ static void ChangeSettingStringByEdit(HWND hwndDlg, UINT ctrlId, int iUser, int mir_free(szNewValue); } else { - char **ppszNew = (char**)(((PBYTE)&tempSettings[iUser]->settings) + memberOffset); + char **ppszNew = (char**)(((uint8_t*)&tempSettings[iUser]->settings) + memberOffset); mir_free(*ppszNew); *ppszNew = szNewValue; } diff --git a/src/mir_app/src/netlib_pktrecver.cpp b/src/mir_app/src/netlib_pktrecver.cpp index 1ef5fbd5cc..b83e5febf3 100644 --- a/src/mir_app/src/netlib_pktrecver.cpp +++ b/src/mir_app/src/netlib_pktrecver.cpp @@ -36,7 +36,7 @@ MIR_APP_DLL(HANDLE) Netlib_CreatePacketReceiver(HNETLIBCONN nlc, int iMaxSize) nlpr->handleType = NLH_PACKETRECVER; nlpr->nlc = nlc; nlpr->packetRecver.bufferSize = iMaxSize; - nlpr->packetRecver.buffer = (PBYTE)mir_alloc(nlpr->packetRecver.bufferSize); + nlpr->packetRecver.buffer = (uint8_t*)mir_alloc(nlpr->packetRecver.bufferSize); nlpr->packetRecver.bytesUsed = 0; nlpr->packetRecver.bytesAvailable = 0; return nlpr; diff --git a/src/mir_app/src/netlib_sock.cpp b/src/mir_app/src/netlib_sock.cpp index 4cfe8ee4ff..0f2ee2d57f 100644 --- a/src/mir_app/src/netlib_sock.cpp +++ b/src/mir_app/src/netlib_sock.cpp @@ -35,7 +35,7 @@ MIR_APP_DLL(int) Netlib_Send(HNETLIBCONN nlc, const char *buf, int len, int flag return SOCKET_ERROR; int result; - Netlib_Dump(nlc, (PBYTE)buf, len, true, flags); + Netlib_Dump(nlc, (uint8_t*)buf, len, true, flags); if (nlc->hSsl) result = Netlib_SslWrite(nlc->hSsl, buf, len); else @@ -71,7 +71,7 @@ MIR_APP_DLL(int) Netlib_Recv(HNETLIBCONN nlc, char *buf, int len, int flags) if (recvResult <= 0) return recvResult; - Netlib_Dump(nlc, (PBYTE)buf, recvResult, false, flags); + Netlib_Dump(nlc, (uint8_t*)buf, recvResult, false, flags); if ((flags & MSG_PEEK) == 0) { NETLIBNOTIFY nln = { buf, len, flags, recvResult }; diff --git a/src/mir_app/src/proto_interface.cpp b/src/mir_app/src/proto_interface.cpp index 52bf10eea2..fe8e39ca46 100644 --- a/src/mir_app/src/proto_interface.cpp +++ b/src/mir_app/src/proto_interface.cpp @@ -199,7 +199,7 @@ MEVENT PROTO_INTERFACE::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre) dbei.timestamp = pre->timestamp; dbei.eventType = EVENTTYPE_MESSAGE; dbei.cbBlob = (DWORD)mir_strlen(pre->szMessage) + 1; - dbei.pBlob = (PBYTE)pre->szMessage; + dbei.pBlob = (uint8_t*)pre->szMessage; if (pre->flags & PREF_CREATEREAD) dbei.flags |= DBEF_READ; diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp index 87be16993b..3186a09bff 100644 --- a/src/mir_app/src/protocols.cpp +++ b/src/mir_app/src/protocols.cpp @@ -183,7 +183,7 @@ MIR_APP_DLL(MEVENT) Proto_AuthRecv(const char *szProtoName, PROTORECVEVENT *pcre dbei.flags = DBEF_UTF | pcre->flags & (PREF_CREATEREAD ? DBEF_READ : 0); dbei.eventType = EVENTTYPE_AUTHREQUEST; dbei.cbBlob = pcre->lParam; - dbei.pBlob = (PBYTE)pcre->szMessage; + dbei.pBlob = (uint8_t*)pcre->szMessage; return db_event_add(0, &dbei); } -- cgit v1.2.3