summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-02-05 22:03:00 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-02-05 22:03:00 +0300
commit9000595b551d09cbaf14cbfd7b49aa5aca3d9a90 (patch)
treeea5e3f6abb32c518f7f82b10fbcc9ca67e70e13a
parent48dd585af3311ef3e51bf081c37e61b56199a455 (diff)
proper fix for UINs in auth dialogs
-rw-r--r--bin10/lib/mir_app.libbin103298 -> 103574 bytes
-rw-r--r--bin10/lib/mir_app64.libbin98670 -> 98950 bytes
-rw-r--r--bin12/lib/mir_app.libbin103298 -> 103574 bytes
-rw-r--r--bin12/lib/mir_app64.libbin98670 -> 98950 bytes
-rw-r--r--bin14/lib/mir_app.libbin103298 -> 103574 bytes
-rw-r--r--bin14/lib/mir_app64.libbin98670 -> 98950 bytes
-rw-r--r--include/m_database.h4
-rw-r--r--protocols/IcqOscarJ/src/fam_04message.cpp2
-rw-r--r--protocols/IcqOscarJ/src/fam_13servclist.cpp2
-rw-r--r--src/mir_app/src/db_events.cpp4
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
12 files changed, 10 insertions, 4 deletions
diff --git a/bin10/lib/mir_app.lib b/bin10/lib/mir_app.lib
index c2a0c3e080..170a52afca 100644
--- a/bin10/lib/mir_app.lib
+++ b/bin10/lib/mir_app.lib
Binary files differ
diff --git a/bin10/lib/mir_app64.lib b/bin10/lib/mir_app64.lib
index c9c6976d56..4725b97a31 100644
--- a/bin10/lib/mir_app64.lib
+++ b/bin10/lib/mir_app64.lib
Binary files differ
diff --git a/bin12/lib/mir_app.lib b/bin12/lib/mir_app.lib
index c2a0c3e080..170a52afca 100644
--- a/bin12/lib/mir_app.lib
+++ b/bin12/lib/mir_app.lib
Binary files differ
diff --git a/bin12/lib/mir_app64.lib b/bin12/lib/mir_app64.lib
index c9c6976d56..4725b97a31 100644
--- a/bin12/lib/mir_app64.lib
+++ b/bin12/lib/mir_app64.lib
Binary files differ
diff --git a/bin14/lib/mir_app.lib b/bin14/lib/mir_app.lib
index c2a0c3e080..170a52afca 100644
--- a/bin14/lib/mir_app.lib
+++ b/bin14/lib/mir_app.lib
Binary files differ
diff --git a/bin14/lib/mir_app64.lib b/bin14/lib/mir_app64.lib
index c9c6976d56..4725b97a31 100644
--- a/bin14/lib/mir_app64.lib
+++ b/bin14/lib/mir_app64.lib
Binary files differ
diff --git a/include/m_database.h b/include/m_database.h
index 23926eba9b..f4d7b1ea46 100644
--- a/include/m_database.h
+++ b/include/m_database.h
@@ -680,7 +680,9 @@ public:
__forceinline const char* get_lastName() const { return m_szLastName; }
__forceinline const char* get_email() const { return m_szEmail; }
__forceinline const char* get_reason() const { return m_szReason; }
- __forceinline DWORD get_uin() const { return m_dwUin; }
+
+ __forceinline DWORD get_uin() const { return m_dwUin; }
+ __forceinline void set_uin(DWORD dwValue) { m_dwUin = dwValue; }
};
#endif // M_DATABASE_H__
diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp
index a86ee63662..25ed7614d9 100644
--- a/protocols/IcqOscarJ/src/fam_04message.cpp
+++ b/protocols/IcqOscarJ/src/fam_04message.cpp
@@ -1628,7 +1628,7 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp,
}
{
DB_AUTH_BLOB blob(hContact, pszMsgField[0], pszMsgField[1], pszMsgField[2], pszMsgField[3], pszMsgField[5]);
- *(DWORD*)(PBYTE)blob = dwUin;
+ blob.set_uin(dwUin);
PROTORECVEVENT pre = { 0 };
pre.timestamp = dwTimestamp;
diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp
index 3e7b1004db..4d7e78c0b4 100644
--- a/protocols/IcqOscarJ/src/fam_13servclist.cpp
+++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp
@@ -1392,7 +1392,7 @@ void CIcqProto::handleRecvAuthRequest(unsigned char *buf, size_t wLen)
szNick = null_strdup(szUid);
DB_AUTH_BLOB blob(hContact, szNick, 0, 0, 0, szReason);
- *(DWORD*)(PBYTE)blob = dwUin;
+ blob.set_uin(dwUin);
setByte(hContact, "Grant", 1);
diff --git a/src/mir_app/src/db_events.cpp b/src/mir_app/src/db_events.cpp
index 24dbeb55a8..dac49009ce 100644
--- a/src/mir_app/src/db_events.cpp
+++ b/src/mir_app/src/db_events.cpp
@@ -265,6 +265,7 @@ MIR_APP_DLL(wchar_t*) DbEvent_GetString(DBEVENTINFO *dbei, const char *str)
/////////////////////////////////////////////////////////////////////////////////////////
DB_AUTH_BLOB::DB_AUTH_BLOB(MCONTACT hContact, LPCSTR nick, LPCSTR fname, LPCSTR lname, LPCSTR email, LPCSTR reason) :
+ m_dwUin(0),
m_hContact(hContact),
m_szNick(mir_strdup(nick)),
m_szFirstName(mir_strdup(fname)),
@@ -278,6 +279,7 @@ DB_AUTH_BLOB::DB_AUTH_BLOB(MCONTACT hContact, LPCSTR nick, LPCSTR fname, LPCSTR
DB_AUTH_BLOB::DB_AUTH_BLOB(PBYTE blob)
{
PBYTE pCurBlob = blob;
+ m_dwUin = *(PDWORD)pCurBlob;
pCurBlob += sizeof(DWORD);
m_hContact = *(PDWORD)pCurBlob;
pCurBlob += sizeof(DWORD);
@@ -298,7 +300,7 @@ PBYTE DB_AUTH_BLOB::makeBlob()
PBYTE pBlob, pCurBlob;
pCurBlob = pBlob = (PBYTE)mir_alloc(m_size + 1);
- *((PDWORD)pCurBlob) = 0;
+ *((PDWORD)pCurBlob) = m_dwUin;
pCurBlob += sizeof(DWORD);
*((PDWORD)pCurBlob) = (DWORD)m_hContact;
pCurBlob += sizeof(DWORD);
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 473761ff35..baf17bf743 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -398,3 +398,4 @@ Netlib_NtlmCreateResponse @383
Chat_UnescapeTags @399 NONAME
ProtoGetAvatarFormatByMimeType @400
ProtoGetAvatarMimeType @401
+?set_uin@DB_AUTH_BLOB@@QAEXK@Z @402 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 044ee43a95..b60684fb88 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -398,3 +398,4 @@ Netlib_NtlmCreateResponse @383
Chat_UnescapeTags @399 NONAME
ProtoGetAvatarFormatByMimeType @400
ProtoGetAvatarMimeType @401
+?set_uin@DB_AUTH_BLOB@@QEAAXK@Z @402 NONAME