diff options
author | George Hazan <george.hazan@gmail.com> | 2013-09-24 11:14:26 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-09-24 11:14:26 +0000 |
commit | 76b283677bd66b4f41289bc211504834bb0f0513 (patch) | |
tree | cd23344d78bd5457f9f95176807fd1fa260df530 /src | |
parent | 55cfa8393ae222c2b48d7dfcf1d493021ff5bb47 (diff) |
PROTORECVEVENT::pCustomData field added to add user-defined into to incoming messages
git-svn-id: http://svn.miranda-ng.org/main/trunk@6206 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/protocols/protocols.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp index da68984d7c..efcd69ffba 100644 --- a/src/modules/protocols/protocols.cpp +++ b/src/modules/protocols/protocols.cpp @@ -149,6 +149,7 @@ static INT_PTR Proto_RecvMessage(WPARAM, LPARAM lParam) return NULL;
ptrA pszTemp;
+ mir_ptr<BYTE> pszBlob;
DBEVENTINFO dbei = { 0 };
dbei.cbSize = sizeof(dbei);
@@ -163,7 +164,15 @@ static INT_PTR Proto_RecvMessage(WPARAM, LPARAM lParam) }
else {
dbei.cbBlob = (DWORD)strlen(pre->szMessage) + 1;
- dbei.pBlob = (PBYTE) pre->szMessage;
+ dbei.pBlob = (PBYTE)pre->szMessage;
+ }
+
+ if (pre->cbCustomDataSize != 0) {
+ pszBlob = (PBYTE)mir_alloc(dbei.cbBlob + pre->cbCustomDataSize);
+ memcpy(pszBlob, dbei.pBlob, dbei.cbBlob);
+ memcpy((PBYTE)pszBlob + dbei.cbBlob, pre->pCustomData, pre->cbCustomDataSize);
+ dbei.pBlob = pszBlob;
+ dbei.cbBlob += pre->cbCustomDataSize;
}
if (pre->flags & PREF_CREATEREAD)
|