diff options
Diffstat (limited to 'plugins')
99 files changed, 299 insertions, 299 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<IImport::ExternalMessage>& 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<DWORD, IImport::ExternalMessage>(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<IImport::ExternalMessage> 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<AES>::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<AES>::Encryption enc((PBYTE)p->aes_k.data(), p->aes_k.length(), (PBYTE)p->aes_v.data());
+ CBC_Mode<AES>::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<AES>::Decryption dec((PBYTE)p->aes_k.data(), p->aes_k.length(), (PBYTE)p->aes_v.data());
+ CBC_Mode<AES>::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<AES>::Encryption enc((PBYTE)p->aes_k.data(), p->aes_k.length(), (PBYTE)p->aes_v.data());
+ CBC_Mode<AES>::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<AES>::Decryption dec((PBYTE)p->aes_k.data(), p->aes_k.length(), (PBYTE)p->aes_v.data());
+ CBC_Mode<AES>::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<AES>::Encryption enc((PBYTE)key.data(), key.length(), (PBYTE)iv.data());
+ CBC_Mode<AES>::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<AES>::Decryption dec((PBYTE)key.data(), key.length(), (PBYTE)iv.data());
+ CBC_Mode<AES>::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<AES>::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<AES>::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<PBYTE>(realloc(ei.dbe.pBlob, ei.dbe.cbBlob + 1));
+ ei.dbe.pBlob = reinterpret_cast<uint8_t*>(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<BYTE> tmpVal((PBYTE)mir_base64_decode(tmp, &baselen));
+ mir_ptr<BYTE> 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);
}
|