summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dbx_mdbx/src')
-rw-r--r--plugins/Dbx_mdbx/src/dbcrypt.cpp10
-rw-r--r--plugins/Dbx_mdbx/src/dbevents.cpp12
-rw-r--r--plugins/Dbx_mdbx/src/dbintf.cpp4
-rw-r--r--plugins/Dbx_mdbx/src/dbintf.h6
-rw-r--r--plugins/Dbx_mdbx/src/dbsettings.cpp8
5 files changed, 20 insertions, 20 deletions
diff --git a/plugins/Dbx_mdbx/src/dbcrypt.cpp b/plugins/Dbx_mdbx/src/dbcrypt.cpp
index 39251349c5..b58967b3b8 100644
--- a/plugins/Dbx_mdbx/src/dbcrypt.cpp
+++ b/plugins/Dbx_mdbx/src/dbcrypt.cpp
@@ -44,7 +44,7 @@ STDMETHODIMP_(BOOL) CDbxMDBX::ReadCryptoKey(MBinBuffer &buf)
STDMETHODIMP_(BOOL) CDbxMDBX::StoreCryptoKey()
{
size_t iKeyLength = m_crypto->getKeyLength();
- BYTE *pKey = (BYTE*)_alloca(iKeyLength);
+ uint8_t *pKey = (uint8_t*)_alloca(iKeyLength);
m_crypto->getKey(pKey, iKeyLength);
{
txn_ptr trnlck(this);
@@ -129,15 +129,15 @@ STDMETHODIMP_(BOOL) CDbxMDBX::EnableEncryption(BOOL bEncrypted)
}
const DBEvent *dbEvent = (const DBEvent*)data.iov_base;
- const BYTE *pBlob = (BYTE*)(dbEvent + 1);
+ const uint8_t *pBlob = (uint8_t*)(dbEvent + 1);
if (((dbEvent->flags & DBEF_ENCRYPTED) != 0) != bEncrypted) {
- mir_ptr<BYTE> pNewBlob;
+ mir_ptr<uint8_t> pNewBlob;
size_t nNewBlob;
uint32_t dwNewFlags;
if (dbEvent->flags & DBEF_ENCRYPTED) {
- pNewBlob = (BYTE*)m_crypto->decodeBuffer(pBlob, dbEvent->cbBlob, &nNewBlob);
+ pNewBlob = (uint8_t*)m_crypto->decodeBuffer(pBlob, dbEvent->cbBlob, &nNewBlob);
dwNewFlags = dbEvent->flags & (~DBEF_ENCRYPTED);
}
else {
@@ -146,7 +146,7 @@ STDMETHODIMP_(BOOL) CDbxMDBX::EnableEncryption(BOOL bEncrypted)
}
data.iov_len = sizeof(DBEvent) + nNewBlob;
- mir_ptr<BYTE> pData((BYTE*)mir_alloc(data.iov_len));
+ mir_ptr<uint8_t> pData((uint8_t*)mir_alloc(data.iov_len));
data.iov_base = pData.get();
DBEvent *pNewDBEvent = (DBEvent *)data.iov_base;
diff --git a/plugins/Dbx_mdbx/src/dbevents.cpp b/plugins/Dbx_mdbx/src/dbevents.cpp
index 8bfd07e297..18b59b6606 100644
--- a/plugins/Dbx_mdbx/src/dbevents.cpp
+++ b/plugins/Dbx_mdbx/src/dbevents.cpp
@@ -188,12 +188,12 @@ bool CDbxMDBX::EditEvent(MCONTACT contactID, MEVENT hDbEvent, const DBEVENTINFO
dbe.flags = dbei->flags;
dbe.wEventType = dbei->eventType;
dbe.cbBlob = dbei->cbBlob;
- BYTE *pBlob = dbei->pBlob;
+ uint8_t *pBlob = dbei->pBlob;
- mir_ptr<BYTE> pCryptBlob;
+ mir_ptr<uint8_t> pCryptBlob;
if (m_bEncrypted) {
size_t len;
- BYTE *pResult = m_crypto->encodeBuffer(pBlob, dbe.cbBlob, &len);
+ uint8_t *pResult = m_crypto->encodeBuffer(pBlob, dbe.cbBlob, &len);
if (pResult != nullptr) {
pCryptBlob = pBlob = pResult;
dbe.cbBlob = (uint16_t)len;
@@ -207,7 +207,7 @@ bool CDbxMDBX::EditEvent(MCONTACT contactID, MEVENT hDbEvent, const DBEVENTINFO
dbe.flags |= DBEF_HAS_ID;
}
- BYTE *recBuf = (BYTE*)_alloca(sizeof(dbe) + dbe.cbBlob + cbSrvId + 2), *p = recBuf;
+ uint8_t *recBuf = (uint8_t*)_alloca(sizeof(dbe) + dbe.cbBlob + cbSrvId + 2), *p = recBuf;
memcpy(p, &dbe, sizeof(dbe)); p += sizeof(dbe);
memcpy(p, pBlob, dbe.cbBlob); p += dbe.cbBlob;
if (*p != 0)
@@ -319,11 +319,11 @@ BOOL CDbxMDBX::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei)
dbei->cbBlob = (DWORD)cbBlob;
if (bytesToCopy && dbei->pBlob) {
- BYTE *pSrc = (BYTE*)dbe + sizeof(DBEvent);
+ uint8_t *pSrc = (uint8_t*)dbe + sizeof(DBEvent);
if (dbe->flags & DBEF_ENCRYPTED) {
dbei->flags &= ~DBEF_ENCRYPTED;
size_t len;
- BYTE* pBlob = (BYTE*)m_crypto->decodeBuffer(pSrc, dbe->cbBlob, &len);
+ uint8_t* pBlob = (uint8_t*)m_crypto->decodeBuffer(pSrc, dbe->cbBlob, &len);
if (pBlob == nullptr)
return 1;
diff --git a/plugins/Dbx_mdbx/src/dbintf.cpp b/plugins/Dbx_mdbx/src/dbintf.cpp
index 9d3e44a910..3875eaae54 100644
--- a/plugins/Dbx_mdbx/src/dbintf.cpp
+++ b/plugins/Dbx_mdbx/src/dbintf.cpp
@@ -91,7 +91,7 @@ LBL_Fail:
/////////////////////////////////////////////////////////////////////////////////////////
size_t iDefHeaderOffset = 0;
-BYTE bDefHeader[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+uint8_t bDefHeader[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
int CDbxMDBX::Check(void)
{
@@ -100,7 +100,7 @@ int CDbxMDBX::Check(void)
return EGROKPRF_CANTREAD;
fseek(pFile, (LONG)iDefHeaderOffset, SEEK_SET);
- BYTE buf[_countof(bDefHeader)];
+ uint8_t buf[_countof(bDefHeader)];
size_t cbRead = fread(buf, 1, _countof(buf), pFile);
fclose(pFile);
if (cbRead != _countof(buf))
diff --git a/plugins/Dbx_mdbx/src/dbintf.h b/plugins/Dbx_mdbx/src/dbintf.h
index f847c43730..47be0cc7c2 100644
--- a/plugins/Dbx_mdbx/src/dbintf.h
+++ b/plugins/Dbx_mdbx/src/dbintf.h
@@ -94,10 +94,10 @@ struct DBSettingKey
struct DBSettingValue
{
- BYTE type;
+ uint8_t type;
union
{
- BYTE bVal;
+ uint8_t bVal;
WORD wVal;
DWORD dwVal;
char szVal[];
@@ -105,7 +105,7 @@ struct DBSettingValue
struct
{
size_t nLength;
- BYTE bVal[];
+ uint8_t bVal[];
} blob;
};
};
diff --git a/plugins/Dbx_mdbx/src/dbsettings.cpp b/plugins/Dbx_mdbx/src/dbsettings.cpp
index c7d99f92f8..103bcfb636 100644
--- a/plugins/Dbx_mdbx/src/dbsettings.cpp
+++ b/plugins/Dbx_mdbx/src/dbsettings.cpp
@@ -36,7 +36,7 @@ void CDbxMDBX::FillSettings()
if (szModule == nullptr)
continue;
- const BYTE *pBlob = (const BYTE*)data.iov_base;
+ const uint8_t *pBlob = (const uint8_t*)data.iov_base;
if (*pBlob == DBVT_DELETED)
continue;
@@ -51,7 +51,7 @@ void CDbxMDBX::FillSettings()
WORD varLen;
- BYTE iType = dbv->type = pBlob[0]; pBlob++;
+ uint8_t iType = dbv->type = pBlob[0]; pBlob++;
switch (iType) {
case DBVT_BYTE: dbv->bVal = *pBlob; break;
case DBVT_WORD: dbv->wVal = *(WORD*)pBlob; break;
@@ -70,7 +70,7 @@ void CDbxMDBX::FillSettings()
case DBVT_ENCRYPTED:
varLen = *(WORD*)pBlob;
pBlob += 2;
- dbv->pbVal = (BYTE *)mir_alloc(varLen);
+ dbv->pbVal = (uint8_t *)mir_alloc(varLen);
memcpy(dbv->pbVal, pBlob, varLen);
dbv->cpbVal = varLen;
break;
@@ -113,7 +113,7 @@ BOOL CDbxMDBX::WriteContactSettingWorker(MCONTACT contactID, DBCONTACTWRITESETTI
data.iov_base = _alloca(data.iov_len);
- BYTE *pBlob = (BYTE*)data.iov_base;
+ uint8_t *pBlob = (uint8_t*)data.iov_base;
*pBlob++ = dbcws.value.type;
switch (dbcws.value.type) {
case DBVT_BYTE: *pBlob = dbcws.value.bVal; break;