diff options
-rw-r--r-- | include/m_protoint.h | 48 | ||||
-rw-r--r-- | libs/win32/mir_app.lib | bin | 206244 -> 206224 bytes | |||
-rw-r--r-- | libs/win64/mir_app.lib | bin | 201862 -> 201832 bytes | |||
-rw-r--r-- | protocols/ICQ-WIM/src/proto.cpp | 6 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/proto.h | 2 | ||||
-rw-r--r-- | protocols/IRCG/src/ircproto.cpp | 11 | ||||
-rw-r--r-- | protocols/IRCG/src/ircproto.h | 2 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_proto.cpp | 6 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_proto.h | 4 | ||||
-rw-r--r-- | protocols/Tox/src/tox_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/Tox/src/tox_proto.h | 22 | ||||
-rw-r--r-- | protocols/Tox/src/tox_transfer.cpp | 18 | ||||
-rw-r--r-- | src/core/stdfile/src/fileexistsdlg.cpp | 23 | ||||
-rw-r--r-- | src/core/stdfile/src/filexferdlg.cpp | 5 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 2 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 2 | ||||
-rw-r--r-- | src/mir_app/src/proto_internal.cpp | 7 | ||||
-rw-r--r-- | src/mir_app/src/proto_utils.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/protocols.cpp | 2 |
19 files changed, 74 insertions, 90 deletions
diff --git a/include/m_protoint.h b/include/m_protoint.h index ce815c6e97..8be0fce7f4 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -195,43 +195,43 @@ public: //////////////////////////////////////////////////////////////////////////////////////
// Virtual functions
- virtual MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr);
+ virtual MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr);
virtual MCONTACT AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
-
+
virtual int Authorize(MEVENT hDbEvent);
- virtual int AuthDeny(MEVENT hDbEvent, const wchar_t* szReason);
- virtual int AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
- virtual int AuthRequest(MCONTACT hContact, const wchar_t* szMessage);
-
- virtual HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath);
+ virtual int AuthDeny(MEVENT hDbEvent, const wchar_t *szReason);
+ virtual int AuthRecv(MCONTACT hContact, PROTORECVEVENT *);
+ virtual int AuthRequest(MCONTACT hContact, const wchar_t *szMessage);
+
+ virtual HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath);
virtual int FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason);
- virtual int FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename);
-
+ virtual int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason);
+ virtual int FileResume(HANDLE hTransfer, int action, const wchar_t *szFilename);
+
virtual INT_PTR GetCaps(int type, MCONTACT hContact = NULL);
virtual int GetInfo(MCONTACT hContact, int infoType);
-
- virtual HANDLE SearchBasic(const wchar_t* id);
- virtual HANDLE SearchByEmail(const wchar_t* email);
- virtual HANDLE SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName);
+
+ virtual HANDLE SearchBasic(const wchar_t *id);
+ virtual HANDLE SearchByEmail(const wchar_t *email);
+ virtual HANDLE SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName);
virtual HWND SearchAdvanced(HWND owner);
virtual HWND CreateExtendedSearchUI(HWND owner);
-
- virtual int RecvContacts(MCONTACT hContact, PROTORECVEVENT*);
- virtual int RecvFile(MCONTACT hContact, PROTORECVFILE*);
- virtual MEVENT RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
-
+
+ virtual int RecvContacts(MCONTACT hContact, PROTORECVEVENT *);
+ virtual int RecvFile(MCONTACT hContact, PROTORECVFILE *);
+ virtual MEVENT RecvMsg(MCONTACT hContact, PROTORECVEVENT *);
+
virtual int SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList);
virtual HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
virtual int SendMsg(MCONTACT hContact, int flags, const char *msg);
-
+
virtual int SetApparentMode(MCONTACT hContact, int mode);
virtual int SetStatus(int iNewStatus);
-
+
virtual HANDLE GetAwayMsg(MCONTACT hContact);
- virtual int RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt);
- virtual int SetAwayMsg(int iStatus, const wchar_t* msg);
-
+ virtual int RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT *evt);
+ virtual int SetAwayMsg(int iStatus, const wchar_t *msg);
+
virtual int UserIsTyping(MCONTACT hContact, int type);
//////////////////////////////////////////////////////////////////////////////////////
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex 2283dfc985..69034db1ff 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex c886279092..b065fdad35 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index 3aaba62d5c..6523090d04 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -431,14 +431,14 @@ int CIcqProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) return 0; } -int CIcqProto::FileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename) +int CIcqProto::FileResume(HANDLE hTransfer, int, const wchar_t *szFilename) { auto *ft = (IcqFileTransfer *)hTransfer; if (!m_bOnline || ft == nullptr) return 1; - if (*action == FILERESUME_RENAME) { - ft->m_wszFileName = *szFilename; + if (szFilename != nullptr) { + ft->m_wszFileName = szFilename; ft->pfts.szCurrentFile.w = ft->m_wszFileName.GetBuffer(); } return 0; diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h index 34f8ab8321..d48238a9d0 100644 --- a/protocols/ICQ-WIM/src/proto.h +++ b/protocols/ICQ-WIM/src/proto.h @@ -413,7 +413,7 @@ class CIcqProto : public PROTO<CIcqProto> HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath) override; int FileCancel(MCONTACT hContact, HANDLE hTransfer) override; - int FileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename) override; + int FileResume(HANDLE hTransfer, int action, const wchar_t *szFilename) override; HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override; int SendMsg(MCONTACT hContact, int flags, const char *msg) override; diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 1b4fbb5a31..97c81d76b6 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -381,21 +381,20 @@ int CIrcProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t*) ////////////////////////////////////////////////////////////////////////////////////////
// FileResume - processes file renaming etc
-int CIrcProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
+int CIrcProto::FileResume(HANDLE hTransfer, int action, const wchar_t *szFilename)
{
DCCINFO* di = (DCCINFO*)hTransfer;
- long i = (long)*action;
-
+ long i = action;
CDccSession *dcc = FindDCCSession(di);
if (dcc) {
InterlockedExchange(&dcc->dwWhatNeedsDoing, i);
- if (*action == FILERESUME_RENAME) {
- wchar_t* szTemp = wcsdup(*szFilename);
+ if (action == FILERESUME_RENAME) {
+ wchar_t* szTemp = wcsdup(szFilename);
InterlockedExchangePointer((PVOID*)&dcc->NewFileName, szTemp);
}
- if (*action == FILERESUME_RESUME) {
+ if (action == FILERESUME_RESUME) {
unsigned __int64 dwPos = 0;
struct _stati64 statbuf;
diff --git a/protocols/IRCG/src/ircproto.h b/protocols/IRCG/src/ircproto.h index fb8839d056..6c344ef45d 100644 --- a/protocols/IRCG/src/ircproto.h +++ b/protocols/IRCG/src/ircproto.h @@ -55,7 +55,7 @@ struct CIrcProto : public PROTO<CIrcProto> HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath) override; int FileCancel(MCONTACT hContact, HANDLE hTransfer) override; int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason) override; - int FileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename) override; + int FileResume(HANDLE hTransfer, int action, const wchar_t *szFilename) override; INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override; diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index fe623c111f..be945eb154 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -567,14 +567,14 @@ int CJabberProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t *) ////////////////////////////////////////////////////////////////////////////////////////
// JabberFileResume - processes file renaming etc
-int CJabberProto::FileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename)
+int CJabberProto::FileResume(HANDLE hTransfer, int, const wchar_t *szFilename)
{
filetransfer *ft = (filetransfer*)hTransfer;
if (!m_bJabberOnline || ft == nullptr)
return 1;
- if (*action == FILERESUME_RENAME)
- replaceStrW(ft->std.szCurrentFile.w, *szFilename);
+ if (szFilename != nullptr)
+ replaceStrW(ft->std.szCurrentFile.w, szFilename);
SetEvent(ft->hWaitEvent);
return 0;
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index a5a6c85974..99a116768f 100755 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -105,7 +105,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface // PROTO_INTERFACE
//====================================================================================
- MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override;
+ MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr) override;
MCONTACT AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) override;
int Authorize(MEVENT hDbEvent) override;
@@ -115,7 +115,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath) override;
int FileCancel(MCONTACT hContact, HANDLE hTransfer) override;
int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason) override;
- int FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename) override;
+ int FileResume(HANDLE hTransfer, int action, const wchar_t *szFilename) override;
INT_PTR GetCaps(int type, MCONTACT hContact = 0) override;
int GetInfo(MCONTACT hContact, int infoType) override;
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp index 62d7e3194a..c6ad418329 100644 --- a/protocols/Tox/src/tox_proto.cpp +++ b/protocols/Tox/src/tox_proto.cpp @@ -126,7 +126,7 @@ int CToxProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t*) return FileCancel(hContact, hTransfer);
}
-int CToxProto::FileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename)
+int CToxProto::FileResume(HANDLE hTransfer, int action, const wchar_t *szFilename)
{
if (hTransfer == nullptr) // file resume canceled
return 1;
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index 8b357a0dce..f78985f42b 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -19,30 +19,30 @@ public: //////////////////////////////////////////////////////////////////////////////////////
// Virtual functions
- MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override;
+ MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr) override;
int Authorize(MEVENT hDbEvent) override;
- int AuthRecv(MCONTACT hContact, PROTORECVEVENT*) override;
- int AuthRequest(MCONTACT hContact, const wchar_t* szMessage) override;
+ int AuthRecv(MCONTACT hContact, PROTORECVEVENT *) override;
+ int AuthRequest(MCONTACT hContact, const wchar_t *szMessage) override;
- HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* tszPath) override;
+ HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *tszPath) override;
int FileCancel(MCONTACT hContact, HANDLE hTransfer) override;
- int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* tszReason) override;
- int FileResume(HANDLE hTransfer, int* action, const wchar_t** tszFilename) override;
+ int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *tszReason) override;
+ int FileResume(HANDLE hTransfer, int action, const wchar_t *tszFilename) override;
INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
-
+
HWND SearchAdvanced(HWND owner) override;
HWND CreateExtendedSearchUI(HWND owner) override;
- int SendMsg(MCONTACT hContact, int flags, const char* msg) override;
+ int SendMsg(MCONTACT hContact, int flags, const char *msg) override;
- HANDLE SendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFiles) override;
+ HANDLE SendFile(MCONTACT hContact, const wchar_t *, wchar_t **ppszFiles) override;
int SetStatus(int iNewStatus) override;
HANDLE GetAwayMsg(MCONTACT hContact) override;
- int SetAwayMsg(int iStatus, const wchar_t* msg) override;
+ int SetAwayMsg(int iStatus, const wchar_t *msg) override;
int UserIsTyping(MCONTACT hContact, int type) override;
@@ -195,7 +195,7 @@ private: // transfer
HANDLE OnFileAllow(Tox *tox, MCONTACT hContact, HANDLE hTransfer, const wchar_t *tszPath);
- int OnFileResume(Tox *tox, HANDLE hTransfer, int *action, const wchar_t **szFilename);
+ int OnFileResume(Tox *tox, HANDLE hTransfer, int action, const wchar_t *szFilename);
HANDLE OnSendFile(Tox *tox, MCONTACT hContact, const wchar_t*, wchar_t **ppszFiles);
int CancelTransfer(MCONTACT hContact, HANDLE hTransfer);
diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp index 659b8d9e2e..ea914bed8d 100644 --- a/protocols/Tox/src/tox_transfer.cpp +++ b/protocols/Tox/src/tox_transfer.cpp @@ -81,32 +81,26 @@ HANDLE CToxProto::OnFileAllow(Tox *tox, MCONTACT hContact, HANDLE hTransfer, con mir_snwprintf(fullPath, L"%s\\%s", transfer->pfts.szWorkingDir.w, transfer->pfts.szCurrentFile.w);
transfer->ChangeName(fullPath);
- if (!ProtoBroadcastAck(hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, (HANDLE)transfer, (LPARAM)&transfer->pfts)) {
- int action = FILERESUME_OVERWRITE;
- const wchar_t **szFilename = (const wchar_t**)mir_alloc(sizeof(wchar_t*) * 2);
- szFilename[0] = fullPath;
- szFilename[1] = nullptr;
- OnFileResume(tox, hTransfer, &action, szFilename);
- mir_free(szFilename);
- }
+ if (!ProtoBroadcastAck(hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, (HANDLE)transfer, (LPARAM)&transfer->pfts))
+ OnFileResume(tox, hTransfer, FILERESUME_OVERWRITE, fullPath);
return hTransfer;
}
// if file is exists
-int CToxProto::OnFileResume(Tox *tox, HANDLE hTransfer, int *action, const wchar_t **szFilename)
+int CToxProto::OnFileResume(Tox *tox, HANDLE hTransfer, int action, const wchar_t *szFilename)
{
FileTransferParam *transfer = (FileTransferParam*)hTransfer;
- if (*action == FILERESUME_SKIP) {
+ if (action == FILERESUME_SKIP) {
tox_file_control(tox, transfer->friendNumber, transfer->fileNumber, TOX_FILE_CONTROL_CANCEL, nullptr);
ProtoBroadcastAck(transfer->pfts.hContact, ACKTYPE_FILE, ACKRESULT_DENIED, (HANDLE)transfer, 0);
transfers.Remove(transfer);
return 0;
}
- if (*action == FILERESUME_RENAME)
- transfer->ChangeName(*szFilename);
+ if (action == FILERESUME_RENAME)
+ transfer->ChangeName(szFilename);
ToxHexAddress pubKey = GetContactPublicKey(tox, transfer->friendNumber);
diff --git a/src/core/stdfile/src/fileexistsdlg.cpp b/src/core/stdfile/src/fileexistsdlg.cpp index c10a9148e0..c5be954f79 100644 --- a/src/core/stdfile/src/fileexistsdlg.cpp +++ b/src/core/stdfile/src/fileexistsdlg.cpp @@ -241,7 +241,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case WM_COMMAND:
{
- PROTOFILERESUME pfr = { 0 };
+ PROTOFILERESUME pfr = {};
switch (LOWORD(wParam)) {
case IDC_OPENFILE:
ShellExecute(hwndDlg, NULL, fts->szCurrentFile.w, NULL, NULL, SW_SHOW);
@@ -278,21 +278,16 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM break;
case IDC_SAVEAS:
- {
- OPENFILENAME ofn = { 0 };
- wchar_t filter[512], *pfilter;
- wchar_t str[MAX_PATH];
+ wchar_t str[MAX_PATH];
+ mir_wstrncpy(str, fts->szCurrentFile.w, _countof(str));
- mir_wstrncpy(str, fts->szCurrentFile.w, _countof(str));
+ wchar_t filter[512];
+ mir_snwprintf(filter, L"%s (*)%c*%c", TranslateT("All files"), 0, 0);
+ {
+ OPENFILENAME ofn = {};
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
- wcsncpy(filter, TranslateT("All files"),_countof(filter)-1);
- mir_wstrcat(filter, L" (*)");
- pfilter = filter + mir_wstrlen(filter) + 1;
- mir_wstrcpy(pfilter, L"*");
- pfilter = pfilter + mir_wstrlen(pfilter) + 1;
- *pfilter = '\0';
ofn.lpstrFilter = filter;
ofn.lpstrFile = str;
ofn.nMaxFile = _countof(str);
@@ -317,9 +312,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM return FALSE;
}
- PROTOFILERESUME *pfrCopy = (PROTOFILERESUME*)mir_alloc(sizeof(pfr));
- memcpy(pfrCopy, &pfr, sizeof(pfr));
- PostMessage((HWND)GetPropA(hwndDlg, "Miranda.ParentWnd"), M_FILEEXISTSDLGREPLY, (WPARAM)mir_wstrdup(fts->szCurrentFile.w), (LPARAM)pfrCopy);
+ PostMessage((HWND)GetPropA(hwndDlg, "Miranda.ParentWnd"), M_FILEEXISTSDLGREPLY, (WPARAM)mir_wstrdup(fts->szCurrentFile.w), (LPARAM)new PROTOFILERESUME(pfr));
DestroyWindow(hwndDlg);
}
break;
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index d969e68478..c652c6b480 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -501,8 +501,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR } mir_free(szOriginalFilename); CallProtoService(szProto, PS_FILERESUME, (WPARAM)dat->fs, (LPARAM)pfr); - if (pfr->szFilename) mir_free((char*)pfr->szFilename); - mir_free(pfr); + delete pfr; } break; @@ -559,7 +558,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR EnableWindow(hwndDlg, FALSE); } else { - PROTOFILERESUME *pfr = (PROTOFILERESUME*)mir_alloc(sizeof(PROTOFILERESUME)); + PROTOFILERESUME *pfr = new PROTOFILERESUME(); pfr->action = dat->resumeBehaviour; pfr->szFilename = nullptr; PostMessage(hwndDlg, M_FILEEXISTSDLGREPLY, (WPARAM)mir_wstrdup(fts->szCurrentFile.w), (LPARAM)pfr); diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 01161746cd..be7e00c7d1 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -45,7 +45,7 @@ Button_SetSkin_IcoLib @24 ?FileAllow@PROTO_INTERFACE@@UAEPAXIPAXPB_W@Z @44 NONAME
?FileCancel@PROTO_INTERFACE@@UAEHIPAX@Z @45 NONAME
?FileDeny@PROTO_INTERFACE@@UAEHIPAXPB_W@Z @46 NONAME
-?FileResume@PROTO_INTERFACE@@UAEHPAXPAHPAPB_W@Z @47 NONAME
+?FileResume@PROTO_INTERFACE@@UAEHPAXHPB_W@Z @47 NONAME
?GetAwayMsg@PROTO_INTERFACE@@UAEPAXI@Z @48 NONAME
?GetCaps@PROTO_INTERFACE@@UAEHHI@Z @49 NONAME
?GetInfo@PROTO_INTERFACE@@UAEHIH@Z @50 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 9ef8a4097a..765d46b37b 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -45,7 +45,7 @@ Button_SetSkin_IcoLib @24 ?FileAllow@PROTO_INTERFACE@@UEAAPEAXIPEAXPEB_W@Z @44 NONAME
?FileCancel@PROTO_INTERFACE@@UEAAHIPEAX@Z @45 NONAME
?FileDeny@PROTO_INTERFACE@@UEAAHIPEAXPEB_W@Z @46 NONAME
-?FileResume@PROTO_INTERFACE@@UEAAHPEAXPEAHPEAPEB_W@Z @47 NONAME
+?FileResume@PROTO_INTERFACE@@UEAAHPEAXHPEB_W@Z @47 NONAME
?GetAwayMsg@PROTO_INTERFACE@@UEAAPEAXI@Z @48 NONAME
?GetCaps@PROTO_INTERFACE@@UEAA_JHI@Z @49 NONAME
?GetInfo@PROTO_INTERFACE@@UEAAHIH@Z @50 NONAME
diff --git a/src/mir_app/src/proto_internal.cpp b/src/mir_app/src/proto_internal.cpp index 0437a44222..4a9b28a65b 100644 --- a/src/mir_app/src/proto_internal.cpp +++ b/src/mir_app/src/proto_internal.cpp @@ -123,16 +123,15 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE return res;
}
- virtual int FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename) override
+ virtual int FileResume(HANDLE hTransfer, int action, const wchar_t *szFilename) override
{
- PROTOFILERESUME pfr = { *action, *szFilename };
+ PROTOFILERESUME pfr = { action, szFilename };
if (m_iVersion > 1)
return (int)ProtoCallService(m_szModuleName, PS_FILERESUME, (WPARAM)hTransfer, (LPARAM)&pfr);
pfr.szFilename = (wchar_t*)mir_u2a(pfr.szFilename);
int res = (int)ProtoCallService(m_szModuleName, PS_FILERESUME, (WPARAM)hTransfer, (LPARAM)&pfr);
- mir_free((wchar_t*)*szFilename);
- *action = pfr.action; *szFilename = (wchar_t*)pfr.szFilename;
+ mir_free((wchar_t*)pfr.szFilename);
return res;
}
diff --git a/src/mir_app/src/proto_utils.cpp b/src/mir_app/src/proto_utils.cpp index f6330ae487..ea34ddbed2 100644 --- a/src/mir_app/src/proto_utils.cpp +++ b/src/mir_app/src/proto_utils.cpp @@ -465,7 +465,7 @@ int PROTO_INTERFACE::FileDeny(MCONTACT, HANDLE, const wchar_t*) return 1; // error
}
-int PROTO_INTERFACE::FileResume(HANDLE, int*, const wchar_t**)
+int PROTO_INTERFACE::FileResume(HANDLE, int, const wchar_t*)
{
return 1; // error
}
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp index 0d90b0cae1..2578c0ef81 100644 --- a/src/mir_app/src/protocols.cpp +++ b/src/mir_app/src/protocols.cpp @@ -407,7 +407,7 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char case 10: return (INT_PTR)ppi->FileDeny(hContact, (HANDLE)wParam, (wchar_t*)lParam);
case 11: {
PROTOFILERESUME *pfr = (PROTOFILERESUME*)lParam;
- return (INT_PTR)ppi->FileResume((HANDLE)wParam, &pfr->action, (const wchar_t**)&pfr->szFilename);
+ return (INT_PTR)ppi->FileResume((HANDLE)wParam, pfr->action, (const wchar_t*)pfr->szFilename);
}
case 12: return (INT_PTR)ppi->GetCaps(wParam, lParam);
|