diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
commit | 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch) | |
tree | 2e8bb660c908b54914abd562af8aafa4a486c846 /protocols/IcqOscarJ | |
parent | a61c8728b379057fe7f0a0d86fe0b037598229dd (diff) |
less TCHARs:
- TCHAR is replaced with wchar_t everywhere;
- LPGENT replaced with either LPGENW or LPGEN;
- fixes for ANSI plugins that improperly used _t functions;
- TCHAR *t removed from MAllStrings;
- ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz*
git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ')
28 files changed, 183 insertions, 183 deletions
diff --git a/protocols/IcqOscarJ/src/cookies.h b/protocols/IcqOscarJ/src/cookies.h index 843cc404ad..37f85c214c 100644 --- a/protocols/IcqOscarJ/src/cookies.h +++ b/protocols/IcqOscarJ/src/cookies.h @@ -109,7 +109,7 @@ struct cookie_avatar size_t hashlen;
BYTE *hash;
size_t cbData;
- TCHAR *szFile;
+ wchar_t *szFile;
};
struct cookie_reverse_connect : public cookie_message_data
diff --git a/protocols/IcqOscarJ/src/db.cpp b/protocols/IcqOscarJ/src/db.cpp index b241e970ec..8cc0736bc0 100644 --- a/protocols/IcqOscarJ/src/db.cpp +++ b/protocols/IcqOscarJ/src/db.cpp @@ -83,7 +83,7 @@ void ChangeInfoData::LoadSettingsFromDb(int keepChanged) }
char buf[MAX_PATH];
- TCHAR tbuf[MAX_PATH];
+ wchar_t tbuf[MAX_PATH];
if (utf8_to_tchar_static(GetItemSettingText(i, buf, _countof(buf)), tbuf, _countof(tbuf)))
ListView_SetItemText(hwndList, i, 1, tbuf);
diff --git a/protocols/IcqOscarJ/src/dlgproc.cpp b/protocols/IcqOscarJ/src/dlgproc.cpp index d6cb25f816..9a99841d22 100644 --- a/protocols/IcqOscarJ/src/dlgproc.cpp +++ b/protocols/IcqOscarJ/src/dlgproc.cpp @@ -201,7 +201,7 @@ INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM LV_ITEM lvi = { 0 };
lvi.mask = LVIF_PARAM | LVIF_TEXT;
for (lvi.iItem = 0; lvi.iItem < settingCount; lvi.iItem++) {
- TCHAR text[MAX_PATH];
+ wchar_t text[MAX_PATH];
lvi.lParam = lvi.iItem;
lvi.pszText = text;
utf8_to_tchar_static(setting[lvi.iItem].szDescription, text, _countof(text));
@@ -464,7 +464,7 @@ INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM dat->hUpload[i] = NULL;
for (done = 0, i = 0; i < _countof(dat->hUpload); i++)
done += dat->hUpload[i] == NULL;
- TCHAR buf[MAX_PATH];
+ wchar_t buf[MAX_PATH];
mir_sntprintf(buf, TranslateT("Upload in progress...%d%%"), 100 * done / (_countof(dat->hUpload)));
SetDlgItemText(hwndDlg, IDC_UPLOADING, buf);
if (done < _countof(dat->hUpload)) break;
diff --git a/protocols/IcqOscarJ/src/editlist.cpp b/protocols/IcqOscarJ/src/editlist.cpp index df0840385a..90b24c5daa 100644 --- a/protocols/IcqOscarJ/src/editlist.cpp +++ b/protocols/IcqOscarJ/src/editlist.cpp @@ -174,7 +174,7 @@ void ChangeInfoData::EndListEdit(int save) if (sid.changed) {
char buf[MAX_PATH];
- TCHAR tbuf[MAX_PATH];
+ wchar_t tbuf[MAX_PATH];
if (utf8_to_tchar_static(ICQTranslateUtfStatic(pItem.text, buf, _countof(buf)), tbuf, _countof(buf)))
ListView_SetItemText(hwndList, iEditItem, 1, tbuf);
diff --git a/protocols/IcqOscarJ/src/editstring.cpp b/protocols/IcqOscarJ/src/editstring.cpp index 94b41836ee..0db3f3db60 100644 --- a/protocols/IcqOscarJ/src/editstring.cpp +++ b/protocols/IcqOscarJ/src/editstring.cpp @@ -323,7 +323,7 @@ void ChangeInfoData::EndStringEdit(int save) }
if (sid.changed) {
- TCHAR tbuf[MAX_PATH];
+ wchar_t tbuf[MAX_PATH];
GetWindowText(hwndEdit, tbuf, _countof(tbuf));
ListView_SetItemText(hwndList, iEditItem, 1, tbuf);
diff --git a/protocols/IcqOscarJ/src/fam_01service.cpp b/protocols/IcqOscarJ/src/fam_01service.cpp index 25610a5bf7..faec561278 100644 --- a/protocols/IcqOscarJ/src/fam_01service.cpp +++ b/protocols/IcqOscarJ/src/fam_01service.cpp @@ -405,7 +405,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, size_t wBufferLength, snac_heade if (m_bAvatarsEnabled && !info->bMyAvatarInited) { // signal the server after login
// this refreshes avatar state - it used to work automatically, but now it does not
if (getByte("ForceOurAvatar", 0)) { // keep our avatar
- TCHAR *file = GetOwnAvatarFileName();
+ wchar_t *file = GetOwnAvatarFileName();
SetMyAvatar(0, (LPARAM)file);
SAFE_FREE(&file);
}
diff --git a/protocols/IcqOscarJ/src/fam_03buddy.cpp b/protocols/IcqOscarJ/src/fam_03buddy.cpp index 36b3abd116..4a86609b9e 100644 --- a/protocols/IcqOscarJ/src/fam_03buddy.cpp +++ b/protocols/IcqOscarJ/src/fam_03buddy.cpp @@ -692,7 +692,7 @@ void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, MCONTACT hContact, osc if (getContactXStatus(hContact) != 0 || !CheckContactCapabilities(hContact, CAPF_STATUS_MESSAGES)) {
setStatusMsgVar(hContact, szStatusNote, false);
- TCHAR *tszNote = mir_utf8decodeT(szStatusNote);
+ wchar_t *tszNote = mir_utf8decodeT(szStatusNote);
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, NULL, (LPARAM)tszNote);
mir_free(tszNote);
}
diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp index da09e845dd..104c7c8652 100644 --- a/protocols/IcqOscarJ/src/fam_04message.cpp +++ b/protocols/IcqOscarJ/src/fam_04message.cpp @@ -948,8 +948,8 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, size_t wLen, DWORD dwUin, c contacts[iContact] = (ICQSEARCHRESULT*)SAFE_MALLOC(sizeof(ICQSEARCHRESULT));
contacts[iContact]->hdr.cbSize = sizeof(ICQSEARCHRESULT);
contacts[iContact]->hdr.flags = PSR_TCHAR;
- contacts[iContact]->hdr.nick.t = null_strdup(L"");
- contacts[iContact]->hdr.id.t = ansi_to_tchar(szUid);
+ contacts[iContact]->hdr.nick.w = null_strdup(L"");
+ contacts[iContact]->hdr.id.w = ansi_to_tchar(szUid);
if (IsStringUIN(szUid)) { // icq contact
contacts[iContact]->uin = atoi(szUid);
@@ -976,8 +976,8 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, size_t wLen, DWORD dwUin, c debugLogA("Malformed '%s' message", "contacts");
disposeChain(&chain);
for (int i = 0; i < iContact; i++) {
- SAFE_FREE(&contacts[i]->hdr.id.t);
- SAFE_FREE(&contacts[i]->hdr.nick.t);
+ SAFE_FREE(&contacts[i]->hdr.id.w);
+ SAFE_FREE(&contacts[i]->hdr.nick.w);
SAFE_FREE((void**)&contacts[i]);
}
SAFE_FREE((void**)&contacts);
@@ -1015,8 +1015,8 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, size_t wLen, DWORD dwUin, c unpackTypedTLV(pBuffer, wNickLen, 0x01, &wNickTLV, &wNickTLVLen, (LPBYTE*)&pNick);
if (wNickTLV == 0x01) {
- SAFE_FREE(&contacts[iContact]->hdr.nick.t);
- contacts[iContact]->hdr.nick.t = utf8_to_tchar(pNick);
+ SAFE_FREE(&contacts[iContact]->hdr.nick.w);
+ contacts[iContact]->hdr.nick.w = utf8_to_tchar(pNick);
}
else
SAFE_FREE(&pNick);
@@ -1051,8 +1051,8 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, size_t wLen, DWORD dwUin, c }
for (int i = 0; i < iContact; i++) {
- SAFE_FREE(&contacts[i]->hdr.id.t);
- SAFE_FREE(&contacts[i]->hdr.nick.t);
+ SAFE_FREE(&contacts[i]->hdr.id.w);
+ SAFE_FREE(&contacts[i]->hdr.nick.w);
SAFE_FREE((void**)&contacts[i]);
}
SAFE_FREE((void**)&contacts);
@@ -1692,8 +1692,8 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp, if (!mir_strlen(pszMsgField[1 + i * 2]))
valid = 0;
}
- isrList[i]->hdr.id.t = ansi_to_tchar(pszMsgField[1 + i * 2]);
- isrList[i]->hdr.nick.t = ansi_to_tchar(pszMsgField[2 + i * 2]);
+ isrList[i]->hdr.id.w = ansi_to_tchar(pszMsgField[1 + i * 2]);
+ isrList[i]->hdr.nick.w = ansi_to_tchar(pszMsgField[2 + i * 2]);
}
if (!valid)
@@ -1710,8 +1710,8 @@ void CIcqProto::handleMessageTypes(DWORD dwUin, char *szUID, DWORD dwTimestamp, }
for (int i = 0; i < nContacts; i++) {
- SAFE_FREE(&isrList[i]->hdr.id.t);
- SAFE_FREE(&isrList[i]->hdr.nick.t);
+ SAFE_FREE(&isrList[i]->hdr.id.w);
+ SAFE_FREE(&isrList[i]->hdr.nick.w);
SAFE_FREE((void**)&isrList[i]);
}
}
diff --git a/protocols/IcqOscarJ/src/fam_0alookup.cpp b/protocols/IcqOscarJ/src/fam_0alookup.cpp index 49a18401a1..bb37764957 100644 --- a/protocols/IcqOscarJ/src/fam_0alookup.cpp +++ b/protocols/IcqOscarJ/src/fam_0alookup.cpp @@ -93,26 +93,26 @@ void CIcqProto::handleLookupEmailReply(BYTE* buf, size_t wLen, DWORD dwCookie) sr.hdr.cbSize = sizeof(sr);
sr.hdr.flags = PSR_TCHAR;
- sr.hdr.email.t = ansi_to_tchar(pCookie->szObject);
+ sr.hdr.email.w = ansi_to_tchar(pCookie->szObject);
// Syntax check, read chain
if (wLen >= 4 && (pChain = readIntoTLVChain(&buf, wLen, 0))) {
for (WORD i = 1; TRUE; i++) { // collect the results
char *szUid = pChain->getString(0x01, i);
if (!szUid) break;
- sr.hdr.id.t = ansi_to_tchar(szUid);
- sr.hdr.nick.t = sr.hdr.id.t;
+ sr.hdr.id.w = ansi_to_tchar(szUid);
+ sr.hdr.nick.w = sr.hdr.id.w;
// broadcast the result
if (pCookie->dwMainId)
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)pCookie->dwMainId, (LPARAM)&sr);
else
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)dwCookie, (LPARAM)&sr);
- SAFE_FREE(&sr.hdr.id.t);
+ SAFE_FREE(&sr.hdr.id.w);
SAFE_FREE(&szUid);
}
disposeChain(&pChain);
}
- SAFE_FREE(&sr.hdr.email.t);
+ SAFE_FREE(&sr.hdr.email.w);
ReleaseLookupCookie(dwCookie, pCookie);
}
diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp index 654bfa7f2e..b3b5a981d8 100644 --- a/protocols/IcqOscarJ/src/fam_15icqserver.cpp +++ b/protocols/IcqOscarJ/src/fam_15icqserver.cpp @@ -340,7 +340,7 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, size_t wPacketLen, WO wPacketLen -= 4;
sr.uin = dwUin;
_itoa(dwUin, szUin, 10);
- sr.hdr.id.t = (TCHAR*)szUin;
+ sr.hdr.id.w = (wchar_t*)szUin;
// Nick
if (wPacketLen < 2)
@@ -350,11 +350,11 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, size_t wPacketLen, WO if (wLen > 0) {
if (wPacketLen < wLen || (databuf[wLen - 1] != 0))
break;
- sr.hdr.nick.t = (TCHAR*)databuf;
+ sr.hdr.nick.w = (wchar_t*)databuf;
databuf += wLen;
}
else {
- sr.hdr.nick.t = NULL;
+ sr.hdr.nick.w = NULL;
}
// First name
@@ -365,10 +365,10 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, size_t wPacketLen, WO if (wLen > 0) {
if (wPacketLen < wLen || (databuf[wLen - 1] != 0))
break;
- sr.hdr.firstName.t = (TCHAR*)databuf;
+ sr.hdr.firstName.w = (wchar_t*)databuf;
databuf += wLen;
}
- else sr.hdr.firstName.t = NULL;
+ else sr.hdr.firstName.w = NULL;
// Last name
if (wPacketLen < 2)
@@ -378,10 +378,10 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, size_t wPacketLen, WO if (wLen > 0) {
if (wPacketLen < wLen || (databuf[wLen - 1] != 0))
break;
- sr.hdr.lastName.t = (TCHAR*)databuf;
+ sr.hdr.lastName.w = (wchar_t*)databuf;
databuf += wLen;
}
- else sr.hdr.lastName.t = NULL;
+ else sr.hdr.lastName.w = NULL;
// E-mail name
if (wPacketLen < 2)
@@ -391,10 +391,10 @@ void CIcqProto::parseSearchReplies(unsigned char *databuf, size_t wPacketLen, WO if (wLen > 0) {
if (wPacketLen < wLen || (databuf[wLen - 1] != 0))
break;
- sr.hdr.email.t = (TCHAR*)databuf;
+ sr.hdr.email.w = (wchar_t*)databuf;
databuf += wLen;
}
- else sr.hdr.email.t = NULL;
+ else sr.hdr.email.w = NULL;
// Authentication needed flag
if (wPacketLen < 1)
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index 130f8796c7..3d03ed6f43 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -54,28 +54,28 @@ avatars_request::~avatars_request() }
}
-TCHAR* CIcqProto::GetOwnAvatarFileName()
+wchar_t* CIcqProto::GetOwnAvatarFileName()
{
DBVARIANT dbvFile = {DBVT_DELETED};
if (getTString(NULL, "AvatarFile", &dbvFile))
return NULL;
- TCHAR tmp[MAX_PATH * 2];
+ wchar_t tmp[MAX_PATH * 2];
PathToAbsoluteT(dbvFile.ptszVal, tmp);
db_free(&dbvFile);
return null_strdup(tmp);
}
-void CIcqProto::GetFullAvatarFileName(int dwUin, const char *szUid, int dwFormat, TCHAR *pszDest, size_t cbLen)
+void CIcqProto::GetFullAvatarFileName(int dwUin, const char *szUid, int dwFormat, wchar_t *pszDest, size_t cbLen)
{
GetAvatarFileName(dwUin, szUid, pszDest, cbLen);
AddAvatarExt(dwFormat, pszDest);
}
-void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, size_t cbLen)
+void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, wchar_t *pszDest, size_t cbLen)
{
- TCHAR szPath[MAX_PATH * 2];
+ wchar_t szPath[MAX_PATH * 2];
mir_sntprintf(szPath, L"%s\\%S\\", VARST(L"%miranda_avatarcache%"), m_szModuleName);
FOLDERSGETDATA fgd = { sizeof(fgd) };
@@ -91,18 +91,18 @@ void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, CreateDirectoryTreeT(szPath);
if (dwUin != 0)
- _ltot(dwUin, pszDest + tPathLen, 10);
+ _ltow(dwUin, pszDest + tPathLen, 10);
else if (szUid) {
- TCHAR* p = mir_a2t(szUid);
+ wchar_t* p = mir_a2t(szUid);
mir_tstrcpy(pszDest + tPathLen, p);
mir_free(p);
}
else {
- TCHAR szBuf[MAX_PATH];
+ wchar_t szBuf[MAX_PATH];
if (CallService(MS_DB_GETPROFILENAMET, MAX_PATH, (LPARAM)szBuf))
mir_tstrcpy(pszDest + tPathLen, L"avatar");
else {
- TCHAR *szLastDot = _tcsrchr(szBuf, '.');
+ wchar_t *szLastDot = wcsrchr(szBuf, '.');
if (szLastDot)
szLastDot[0] = '\0';
@@ -112,15 +112,15 @@ void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, }
}
-void AddAvatarExt(int dwFormat, TCHAR *pszDest)
+void AddAvatarExt(int dwFormat, wchar_t *pszDest)
{
- const TCHAR *ext = ProtoGetAvatarExtension(dwFormat);
+ const wchar_t *ext = ProtoGetAvatarExtension(dwFormat);
mir_tstrcat(pszDest, (*ext == 0) ? L".dat" : ext);
}
#define MD5_BLOCK_SIZE 1024*1024 /* use 1MB blocks */
-BYTE* calcMD5HashOfFile(const TCHAR *tszFile)
+BYTE* calcMD5HashOfFile(const wchar_t *tszFile)
{
BYTE *res = NULL;
@@ -244,11 +244,11 @@ void CIcqProto::handleAvatarOwnerHash(BYTE bFlags, BYTE *pData, size_t nDataLen) setUserInfo();
{
// here we need to find a file, check its hash, if invalid get avatar from server
- TCHAR *file = GetOwnAvatarFileName();
+ wchar_t *file = GetOwnAvatarFileName();
if (!file) { // we have no avatar file, download from server
debugLogA("We have no avatar, requesting from server.");
- TCHAR szFile[MAX_PATH * 2 + 4];
+ wchar_t szFile[MAX_PATH * 2 + 4];
GetAvatarFileName(0, NULL, szFile, MAX_PATH * 2);
GetAvatarData(NULL, m_dwLocalUIN, NULL, pData, 0x14, szFile);
}
@@ -258,7 +258,7 @@ void CIcqProto::handleAvatarOwnerHash(BYTE bFlags, BYTE *pData, size_t nDataLen) if (!hash) { // hash could not be calculated - probably missing file, get avatar from server
debugLogA("We have no avatar, requesting from server.");
- TCHAR szFile[MAX_PATH * 2 + 4];
+ wchar_t szFile[MAX_PATH * 2 + 4];
GetAvatarFileName(0, NULL, szFile, MAX_PATH * 2);
GetAvatarData(NULL, m_dwLocalUIN, NULL, pData, 0x14, szFile);
}
@@ -280,7 +280,7 @@ void CIcqProto::handleAvatarOwnerHash(BYTE bFlags, BYTE *pData, size_t nDataLen) else { // get avatar from server
debugLogA("We have different avatar, requesting new from server.");
- TCHAR tszFile[MAX_PATH * 2 + 4];
+ wchar_t tszFile[MAX_PATH * 2 + 4];
GetAvatarFileName(0, NULL, tszFile, MAX_PATH * 2);
GetAvatarData(NULL, m_dwLocalUIN, NULL, pData, 0x14, tszFile);
}
@@ -295,7 +295,7 @@ void CIcqProto::handleAvatarOwnerHash(BYTE bFlags, BYTE *pData, size_t nDataLen) case 0x81:
// request to re-upload avatar data
if (m_bSsiEnabled) { // we could not change serv-list if it is disabled...
- TCHAR *file = GetOwnAvatarFileName();
+ wchar_t *file = GetOwnAvatarFileName();
if (!file) { // we have no file to upload, remove hash from server
debugLogA("We do not have avatar, removing hash.");
SetMyAvatar(0, 0);
@@ -414,7 +414,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, MCONTACT hCont if (avatarType != -1) { // check settings, should we request avatar immediatelly?
DBVARIANT dbv = { DBVT_DELETED };
- TCHAR tszAvatar[MAX_PATH * 2 + 4];
+ wchar_t tszAvatar[MAX_PATH * 2 + 4];
BYTE bAutoLoad = getByte("AvatarsAutoLoad", DEFAULT_LOAD_AVATARS);
if ((avatarType == AVATAR_HASH_STATIC || avatarType == AVATAR_HASH_MINI) && cbAvatarHash == 0x09 && !memcmp(pAvatarHash + 4, hashEmptyAvatar + 4, 0x05)) { // empty avatar - unlink image, clear hash
@@ -437,7 +437,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, MCONTACT hCont int dwPaFormat = getByte(hContact, "AvatarType", PA_FORMAT_UNKNOWN);
GetFullAvatarFileName(dwUIN, szUID, dwPaFormat, tszAvatar, MAX_PATH * 2);
- if (_taccess(tszAvatar, 0) == 0) { // the file is there, link to contactphoto, save hash
+ if (_waccess(tszAvatar, 0) == 0) { // the file is there, link to contactphoto, save hash
debugLogA("%s has published Avatar. Image was found in the cache.", strUID(dwUIN, szUID));
setSettingBlob(hContact, "AvatarHash", pAvatarHash, cbAvatarHash);
@@ -470,7 +470,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, MCONTACT hCont }
else {
GetFullAvatarFileName(dwUIN, szUID, dwPaFormat, tszAvatar, MAX_PATH * 2);
- if (_taccess(tszAvatar, 0) != 0) { // the file was lost, get it again
+ if (_waccess(tszAvatar, 0) != 0) { // the file was lost, get it again
debugLogA("%s has Avatar. Image is missing.", strUID(dwUIN, szUID));
bJob = 2;
}
@@ -523,7 +523,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, MCONTACT hCont }
// request avatar data from server
-int CIcqProto::GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, size_t hashlen, const TCHAR *file)
+int CIcqProto::GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, size_t hashlen, const wchar_t *file)
{
uid_str szUidData;
char *pszUid = NULL;
@@ -725,7 +725,7 @@ void avatars_server_connection::shutdownConnection() Netlib_Shutdown(hConnection);
}
-DWORD avatars_server_connection::sendGetAvatarRequest(MCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, size_t hashlen, const TCHAR *file)
+DWORD avatars_server_connection::sendGetAvatarRequest(MCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, size_t hashlen, const wchar_t *file)
{
int i;
DWORD dwNow = GetTickCount();
@@ -1209,22 +1209,22 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, size_t wBufferLen if (aValid) {
ppro->debugLogA("Received user avatar, storing (%d bytes).", datalen);
- const TCHAR *ptszExt;
+ const wchar_t *ptszExt;
int dwPaFormat = ProtoGetBufferFormat(pBuffer, &ptszExt);
- TCHAR tszImageFile[MAX_PATH];
+ wchar_t tszImageFile[MAX_PATH];
mir_sntprintf(tszImageFile, L"%s%s", pCookieData->szFile, ptszExt);
ppro->setByte(pCookieData->hContact, "AvatarType", (BYTE)dwPaFormat);
ai.format = dwPaFormat; // set the format
mir_tstrncpy(ai.filename, tszImageFile, _countof(ai.filename));
- int out = _topen(tszImageFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, _S_IREAD | _S_IWRITE);
+ int out = _wopen(tszImageFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, _S_IREAD | _S_IWRITE);
if (out != -1) {
_write(out, pBuffer, (int)datalen);
_close(out);
if (!pCookieData->hContact) { // our avatar, set filename
- TCHAR tmp[MAX_PATH * 2];
+ wchar_t tmp[MAX_PATH * 2];
PathToRelativeT(tszImageFile, tmp);
ppro->setTString(NULL, "AvatarFile", tmp);
}
diff --git a/protocols/IcqOscarJ/src/icq_avatar.h b/protocols/IcqOscarJ/src/icq_avatar.h index 5ba1e03c79..d0346b229b 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.h +++ b/protocols/IcqOscarJ/src/icq_avatar.h @@ -84,7 +84,7 @@ public: __inline BOOL isPending() { return !isLoggedIn; };
__inline BOOL isReady() { return isLoggedIn && isActive && !stopThread; };
- DWORD sendGetAvatarRequest(MCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, size_t hashlen, const TCHAR *file);
+ DWORD sendGetAvatarRequest(MCONTACT hContact, DWORD dwUin, char *szUid, const BYTE *hash, size_t hashlen, const wchar_t *file);
DWORD sendUploadAvatarRequest(MCONTACT hContact, WORD wRef, const BYTE *data, size_t datalen);
};
@@ -96,7 +96,7 @@ struct avatars_request : public MZeroedObject uid_str szUid;
BYTE *hash;
size_t hashlen;
- TCHAR *szFile;
+ wchar_t *szFile;
BYTE *pData;
size_t cbData;
WORD wRef;
@@ -111,8 +111,8 @@ public: #define ART_UPLOAD 2
#define ART_BLOCK 4
-void AddAvatarExt(int dwFormat, TCHAR *pszDest);
+void AddAvatarExt(int dwFormat, wchar_t *pszDest);
-BYTE* calcMD5HashOfFile(const TCHAR *szFile);
+BYTE* calcMD5HashOfFile(const wchar_t *szFile);
#endif /* __ICQ_AVATAR_H */
diff --git a/protocols/IcqOscarJ/src/icq_filerequests.cpp b/protocols/IcqOscarJ/src/icq_filerequests.cpp index 6dd10110d6..e993445c08 100644 --- a/protocols/IcqOscarJ/src/icq_filerequests.cpp +++ b/protocols/IcqOscarJ/src/icq_filerequests.cpp @@ -152,18 +152,18 @@ void CIcqProto::handleFileRequest(PBYTE buf, DWORD dwUin, DWORD dwCookie, DWORD ft->bEmptyDesc = bEmptyDesc;
// Send chain event
- TCHAR* ptszFileName = mir_utf8decodeT(pszFileName);
+ wchar_t* ptszFileName = mir_utf8decodeT(pszFileName);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = mir_utf8decodeT(pszDescription);
- pre.files.t = &ptszFileName;
+ pre.descr.w = mir_utf8decodeT(pszDescription);
+ pre.files.w = &ptszFileName;
pre.lParam = (LPARAM)ft;
ProtoChainRecvFile(hContact, &pre);
- mir_free(pre.descr.t);
+ mir_free(pre.descr.w);
mir_free(ptszFileName);
}
diff --git a/protocols/IcqOscarJ/src/icq_opts.cpp b/protocols/IcqOscarJ/src/icq_opts.cpp index 36c1c1bfb0..a767d5987a 100644 --- a/protocols/IcqOscarJ/src/icq_opts.cpp +++ b/protocols/IcqOscarJ/src/icq_opts.cpp @@ -29,12 +29,12 @@ extern BOOL bPopupService;
-static const TCHAR* szLogLevelDescr[] = {
- LPGENT("Display all problems"),
- LPGENT("Display problems causing possible loss of data"),
- LPGENT("Display explanations for disconnection"),
- LPGENT("Display problems requiring user intervention"),
- LPGENT("Do not display any problems (not recommended)")
+static const wchar_t* szLogLevelDescr[] = {
+ LPGENW("Display all problems"),
+ LPGENW("Display problems causing possible loss of data"),
+ LPGENW("Display explanations for disconnection"),
+ LPGENW("Display problems requiring user intervention"),
+ LPGENW("Do not display any problems (not recommended)")
};
static void LoadDBCheckState(CIcqProto* ppro, HWND hwndDlg, int idCtrl, const char* szSetting, BYTE bDef)
@@ -511,27 +511,27 @@ int CIcqProto::OnOptionsInit(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE odp = { 0 };
odp.position = -800000000;
odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Network");
+ odp.pwszGroup = LPGENW("Network");
odp.dwInitParam = LPARAM(this);
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.ptszTab = LPGENT("Account");
+ odp.pwszTab = LPGENW("Account");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ICQ);
odp.pfnDlgProc = DlgProcIcqOpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Contacts");
+ odp.pwszTab = LPGENW("Contacts");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ICQCONTACTS);
odp.pfnDlgProc = DlgProcIcqContactsOpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Features");
+ odp.pwszTab = LPGENW("Features");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ICQFEATURES);
odp.pfnDlgProc = DlgProcIcqFeaturesOpts;
Options_AddPage(wParam, &odp);
- odp.ptszTab = LPGENT("Privacy");
+ odp.pwszTab = LPGENW("Privacy");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ICQPRIVACY);
odp.pfnDlgProc = DlgProcIcqPrivacyOpts;
Options_AddPage(wParam, &odp);
@@ -541,8 +541,8 @@ int CIcqProto::OnOptionsInit(WPARAM wParam, LPARAM) odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUPS);
odp.groupPosition = 900000000;
odp.pfnDlgProc = DlgProcIcqPopupOpts;
- odp.ptszGroup = LPGENT("Popups");
- odp.ptszTab = NULL;
+ odp.pwszGroup = LPGENW("Popups");
+ odp.pwszTab = NULL;
Options_AddPage(wParam, &odp);
}
return 0;
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 12694a3763..7843f50a10 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -70,7 +70,7 @@ static int CompareContactsCache(const icq_contacts_cache *p1, const icq_contacts return mir_strcmpi(p1->szUid, p2->szUid);
}
-CIcqProto::CIcqProto(const char* aProtoName, const TCHAR* aUserName) :
+CIcqProto::CIcqProto(const char* aProtoName, const wchar_t* aUserName) :
PROTO<CIcqProto>(aProtoName, aUserName),
cookies(10, CompareCookies),
directConns(10, CompareConns),
@@ -157,7 +157,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const TCHAR* aUserName) : // Register netlib users
NETLIBUSER nlu = { 0 };
- TCHAR szBuffer[MAX_PATH + 64];
+ wchar_t szBuffer[MAX_PATH + 64];
mir_sntprintf(szBuffer, TranslateT("%s server connection"), m_tszUserName);
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
@@ -292,17 +292,17 @@ MCONTACT CIcqProto::AddToList(int flags, PROTOSEARCHRESULT *psr) // aim contact
if (isr->hdr.flags & PSR_UNICODE)
- unicode_to_ansi_static((WCHAR*)isr->hdr.id.t, szUid, MAX_PATH);
+ unicode_to_ansi_static((WCHAR*)isr->hdr.id.w, szUid, MAX_PATH);
else
- null_strcpy(szUid, (char*)isr->hdr.id.t, MAX_PATH);
+ null_strcpy(szUid, (char*)isr->hdr.id.w, MAX_PATH);
return (szUid[0] == 0) ? 0 : AddToListByUID(szUid, flags);
}
if (psr->flags & PSR_UNICODE)
- unicode_to_ansi_static((WCHAR*)psr->id.t, szUid, MAX_PATH);
+ unicode_to_ansi_static((WCHAR*)psr->id.w, szUid, MAX_PATH);
else
- null_strcpy(szUid, (char*)psr->id.t, MAX_PATH);
+ null_strcpy(szUid, (char*)psr->id.w, MAX_PATH);
if (szUid[0] == 0)
return 0;
@@ -400,7 +400,7 @@ int CIcqProto::Authorize(MEVENT hDbEvent) ////////////////////////////////////////////////////////////////////////////////////////
// PS_AuthDeny - handles the unsuccessful authorization
-int CIcqProto::AuthDeny(MEVENT hDbEvent, const TCHAR* szReason)
+int CIcqProto::AuthDeny(MEVENT hDbEvent, const wchar_t* szReason)
{
if (icqOnline() && hDbEvent) {
MCONTACT hContact = HContactFromAuthEvent(hDbEvent);
@@ -437,7 +437,7 @@ int __cdecl CIcqProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* pre) ////////////////////////////////////////////////////////////////////////////////////////
// PSS_AUTHREQUEST
-int __cdecl CIcqProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage)
+int __cdecl CIcqProto::AuthRequest(MCONTACT hContact, const wchar_t* szMessage)
{
if (!icqOnline())
return 1;
@@ -463,7 +463,7 @@ int __cdecl CIcqProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage) ////////////////////////////////////////////////////////////////////////////////////////
// PS_FileAllow - starts a file transfer
-HANDLE __cdecl CIcqProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath)
+HANDLE __cdecl CIcqProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath)
{
DWORD dwUin;
uid_str szUid;
@@ -533,7 +533,7 @@ int __cdecl CIcqProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) ////////////////////////////////////////////////////////////////////////////////////////
// PS_FileDeny - denies a file transfer
-int __cdecl CIcqProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason)
+int __cdecl CIcqProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason)
{
int nReturnValue = 1;
basic_filetransfer *bft = (basic_filetransfer*)hTransfer;
@@ -573,7 +573,7 @@ int __cdecl CIcqProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR ////////////////////////////////////////////////////////////////////////////////////////
// PS_FileResume - processes file renaming etc
-int __cdecl CIcqProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename)
+int __cdecl CIcqProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
{
if (icqOnline() && hTransfer) {
basic_filetransfer *ft = (basic_filetransfer *)hTransfer;
@@ -720,10 +720,10 @@ void CIcqProto::CheekySearchThread(void*) if (cheekySearchUin) {
_itoa(cheekySearchUin, szUin, 10);
- isr.hdr.id.t = (TCHAR*)szUin;
+ isr.hdr.id.w = (wchar_t*)szUin;
}
else {
- isr.hdr.id.t = (TCHAR*)cheekySearchUid;
+ isr.hdr.id.w = (wchar_t*)cheekySearchUid;
}
isr.uin = cheekySearchUin;
@@ -733,7 +733,7 @@ void CIcqProto::CheekySearchThread(void*) }
-HANDLE __cdecl CIcqProto::SearchBasic(const TCHAR *pszSearch)
+HANDLE __cdecl CIcqProto::SearchBasic(const wchar_t *pszSearch)
{
if (mir_wstrlen(pszSearch) == 0)
return 0;
@@ -791,7 +791,7 @@ HANDLE __cdecl CIcqProto::SearchBasic(const TCHAR *pszSearch) ////////////////////////////////////////////////////////////////////////////////////////
// SearchByEmail - searches the contact by its e-mail
-HANDLE __cdecl CIcqProto::SearchByEmail(const TCHAR *email)
+HANDLE __cdecl CIcqProto::SearchByEmail(const wchar_t *email)
{
if (email && icqOnline() && mir_wstrlen(email) > 0) {
char *szEmail = tchar_to_ansi(email);
@@ -814,7 +814,7 @@ HANDLE __cdecl CIcqProto::SearchByEmail(const TCHAR *email) ////////////////////////////////////////////////////////////////////////////////////////
// PS_SearchByName - searches the contact by its first or last name, or by a nickname
-HANDLE __cdecl CIcqProto::SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName)
+HANDLE __cdecl CIcqProto::SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName)
{
if (icqOnline()) {
if (nick || firstName || lastName) {
@@ -873,15 +873,15 @@ int __cdecl CIcqProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) DWORD flags = DBEF_UTF;
for (i = 0; i < pre->lParam; i++) {
- cbBlob += mir_strlen((char*)isrList[i]->hdr.nick.t) + 2; // both trailing zeros
+ cbBlob += mir_strlen((char*)isrList[i]->hdr.nick.w) + 2; // both trailing zeros
if (isrList[i]->uin)
cbBlob += getUINLen(isrList[i]->uin);
else
- cbBlob += mir_strlen((char*)isrList[i]->hdr.id.t);
+ cbBlob += mir_strlen((char*)isrList[i]->hdr.id.w);
}
PBYTE pBlob = (PBYTE)_alloca(cbBlob), pCurBlob;
for (i = 0, pCurBlob = pBlob; i < pre->lParam; i++) {
- mir_strcpy((char*)pCurBlob, (char*)isrList[i]->hdr.nick.t);
+ mir_strcpy((char*)pCurBlob, (char*)isrList[i]->hdr.nick.w);
pCurBlob += mir_strlen((char*)pCurBlob) + 1;
if (isrList[i]->uin) {
char szUin[UINMAXLEN];
@@ -889,7 +889,7 @@ int __cdecl CIcqProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) mir_strcpy((char*)pCurBlob, szUin);
}
else // aim contact
- mir_strcpy((char*)pCurBlob, (char*)isrList[i]->hdr.id.t);
+ mir_strcpy((char*)pCurBlob, (char*)isrList[i]->hdr.id.w);
pCurBlob += mir_strlen((char*)pCurBlob) + 1;
}
@@ -1157,7 +1157,7 @@ int __cdecl CIcqProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONT ////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CIcqProto::SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles)
+HANDLE __cdecl CIcqProto::SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles)
{
if (!icqOnline())
return 0;
@@ -1191,7 +1191,7 @@ HANDLE __cdecl CIcqProto::SendFile(MCONTACT hContact, const TCHAR* szDescription for (i = 0; i < (int)ft->dwFileCount; i++) {
ft->pszFiles[i] = (ppszFiles[i]) ? tchar_to_utf8(ppszFiles[i]) : NULL;
- if (_tstat(ppszFiles[i], &statbuf))
+ if (_wstat(ppszFiles[i], &statbuf))
debugLogA("IcqSendFile() was passed invalid filename(s)");
else
ft->dwTotalSize += statbuf.st_size;
@@ -1644,7 +1644,7 @@ void __cdecl CIcqProto::GetAwayMsgThread(void *pStatusData) setStatusMsgVar(pThreadData->hContact, pThreadData->szMessage, false);
- TCHAR *tszMsg = mir_utf8decodeT(pThreadData->szMessage);
+ wchar_t *tszMsg = mir_utf8decodeT(pThreadData->szMessage);
ProtoBroadcastAck(pThreadData->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, pThreadData->hProcess, (LPARAM)tszMsg);
mir_free(tszMsg);
@@ -1743,7 +1743,7 @@ int __cdecl CIcqProto::RecvAwayMsg(MCONTACT hContact, int, PROTORECVEVENT* evt) {
setStatusMsgVar(hContact, evt->szMessage, false);
- TCHAR* pszMsg = mir_utf8decodeT(evt->szMessage);
+ wchar_t* pszMsg = mir_utf8decodeT(evt->szMessage);
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)evt->lParam, (LPARAM)pszMsg);
mir_free(pszMsg);
return 0;
@@ -1753,7 +1753,7 @@ int __cdecl CIcqProto::RecvAwayMsg(MCONTACT hContact, int, PROTORECVEVENT* evt) ////////////////////////////////////////////////////////////////////////////////////////
// PS_SetAwayMsg - sets the away status message
-int __cdecl CIcqProto::SetAwayMsg(int status, const TCHAR* msg)
+int __cdecl CIcqProto::SetAwayMsg(int status, const wchar_t* msg)
{
mir_cslock l(m_modeMsgsMutex);
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h index 97ca496006..3c5da05d35 100644 --- a/protocols/IcqOscarJ/src/icq_proto.h +++ b/protocols/IcqOscarJ/src/icq_proto.h @@ -47,7 +47,7 @@ struct userinfo struct CIcqProto : public PROTO<CIcqProto>
{
- CIcqProto(const char*, const TCHAR*);
+ CIcqProto(const char*, const wchar_t*);
~CIcqProto();
//====================================================================================
@@ -58,21 +58,21 @@ struct CIcqProto : public PROTO<CIcqProto> virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, MEVENT hDbEvent);
virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason);
+ virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage);
+ virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t *szMessage);
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
+ virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath);
virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
- virtual int __cdecl FileResume( HANDLE hTransfer, int *action, const TCHAR **szFilename);
+ virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason);
+ virtual int __cdecl FileResume( HANDLE hTransfer, int *action, const wchar_t **szFilename);
virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic(const TCHAR *id);
- virtual HANDLE __cdecl SearchByEmail(const TCHAR *email);
- virtual HANDLE __cdecl SearchByName(const TCHAR *nick, const TCHAR *firstName, const TCHAR *lastName);
+ virtual HANDLE __cdecl SearchBasic(const wchar_t *id);
+ virtual HANDLE __cdecl SearchByEmail(const wchar_t *email);
+ virtual HANDLE __cdecl SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName);
virtual HWND __cdecl SearchAdvanced(HWND owner);
virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
@@ -80,7 +80,7 @@ struct CIcqProto : public PROTO<CIcqProto> virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles);
+ virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char *msg);
virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char *url);
@@ -89,7 +89,7 @@ struct CIcqProto : public PROTO<CIcqProto> virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT *evt);
- virtual int __cdecl SetAwayMsg(int m_iStatus, const TCHAR *msg);
+ virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t *msg);
virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
@@ -392,12 +392,12 @@ struct CIcqProto : public PROTO<CIcqProto> void handleAvatarOwnerHash(BYTE bFlags, BYTE *pData, size_t nDataLen);
void handleAvatarContactHash(DWORD dwUIN, char *szUID, MCONTACT hContact, BYTE *pHash, size_t nHashLen);
- TCHAR* GetOwnAvatarFileName();
- void GetFullAvatarFileName(int dwUin, const char *szUid, int dwFormat, TCHAR *pszDest, size_t cbLen);
- void GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, size_t cbLen);
+ wchar_t* GetOwnAvatarFileName();
+ void GetFullAvatarFileName(int dwUin, const char *szUid, int dwFormat, wchar_t *pszDest, size_t cbLen);
+ void GetAvatarFileName(int dwUin, const char *szUid, wchar_t *pszDest, size_t cbLen);
int IsAvatarChanged(MCONTACT hContact, const BYTE *pHash, size_t nHashLen);
- int GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, size_t hashlen, const TCHAR *file);
+ int GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, const BYTE *hash, size_t hashlen, const wchar_t *file);
int SetAvatarData(MCONTACT hContact, WORD wRef, const BYTE *data, size_t datalen);
void StartAvatarThread(HANDLE hConn, char* cookie, size_t cookieLen);
@@ -715,7 +715,7 @@ struct CIcqProto : public PROTO<CIcqProto> void icq_sendRevokeAuthServ(DWORD dwUin, char *szUid);
void icq_sendGrantAuthServ(DWORD dwUin, const char *szUid, const char *szMsg);
void icq_sendAuthReqServ(DWORD dwUin, char* szUid, const char *szMsg);
- void icq_sendAuthResponseServ(DWORD dwUin, char* szUid,int auth,const TCHAR *szReason);
+ void icq_sendAuthResponseServ(DWORD dwUin, char* szUid,int auth,const wchar_t *szReason);
void icq_sendYouWereAddedServ(DWORD,DWORD);
DWORD sendDirectorySearchPacket(const BYTE *pSearchData, size_t wDataLen, WORD wPage, BOOL bOnlineUsersOnly);
@@ -823,11 +823,11 @@ struct CIcqProto : public PROTO<CIcqProto> void handleRecvServMsgOFT(BYTE *buf, size_t wLen, DWORD dwUin, char *szUID, DWORD dwID1, DWORD dwID2, WORD wCommand);
void handleRecvServResponseOFT(BYTE *buf, size_t wLen, DWORD dwUin, char *szUID, void* ft);
- HANDLE oftInitTransfer(MCONTACT hContact, DWORD dwUin, char *szUid, const TCHAR **pszFiles, const TCHAR *szDescription);
- HANDLE oftFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath);
- DWORD oftFileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szReason);
+ HANDLE oftInitTransfer(MCONTACT hContact, DWORD dwUin, char *szUid, const wchar_t **pszFiles, const wchar_t *szDescription);
+ HANDLE oftFileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath);
+ DWORD oftFileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason);
DWORD oftFileCancel(MCONTACT hContact, HANDLE hTransfer);
- void oftFileResume(oscar_filetransfer *ft, int action, const TCHAR *szFilename);
+ void oftFileResume(oscar_filetransfer *ft, int action, const wchar_t *szFilename);
void sendOscarPacket(oscar_connection *oc, icq_packet *packet);
void handleOFT2FramePacket(oscar_connection *oc, WORD datatype, BYTE *pBuffer, size_t wLen);
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index 0769d7b69c..4c91d239ac 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -1377,11 +1377,11 @@ int CIcqProto::getCListGroupExists(const char *szGroup) return 0;
size_t size = mir_strlen(szGroup) + 2;
- TCHAR *tszGroup = (TCHAR*)_alloca(size * sizeof(TCHAR));
+ wchar_t *tszGroup = (wchar_t*)_alloca(size * sizeof(wchar_t));
if (utf8_to_tchar_static(szGroup, tszGroup, size))
for (int i = 1; TRUE; i++) {
- TCHAR *tszGroupName = (TCHAR*)Clist_GroupGetName(i, NULL);
+ wchar_t *tszGroupName = (wchar_t*)Clist_GroupGetName(i, NULL);
if (!tszGroupName)
break;
diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp index fa1dbf5f52..b99b17b95e 100644 --- a/protocols/IcqOscarJ/src/icq_uploadui.cpp +++ b/protocols/IcqOscarJ/src/icq_uploadui.cpp @@ -826,7 +826,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg, UINT message, WPARAM wPa CLCINFOITEM cii = { 0 };
cii.cbSize = sizeof(cii);
cii.flags = CLCIIF_GROUPFONT | CLCIIF_CHECKBOX;
- cii.pszText = TranslateT(LPGEN("** All contacts **"));
+ cii.pszText = TranslateT("** All contacts **");
hItemAll = (HANDLE)SendMessage(hClist, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
}
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index 3168d290ec..ecc192ac4d 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -120,9 +120,9 @@ DWORD CIcqProto::requestXStatusDetails(MCONTACT hContact, BOOL bAllowDelay) return -1; // delayed
}
-static HANDLE LoadXStatusIconLibrary(TCHAR *path, const TCHAR *sub)
+static HANDLE LoadXStatusIconLibrary(wchar_t *path, const wchar_t *sub)
{
- TCHAR* p = _tcsrchr(path, '\\');
+ wchar_t* p = wcsrchr(path, '\\');
HANDLE hLib;
mir_tstrcpy(p, sub);
@@ -137,9 +137,9 @@ static HANDLE LoadXStatusIconLibrary(TCHAR *path, const TCHAR *sub) return hLib;
}
-static TCHAR* InitXStatusIconLibrary(TCHAR *buf, size_t buf_size)
+static wchar_t* InitXStatusIconLibrary(wchar_t *buf, size_t buf_size)
{
- TCHAR path[2 * MAX_PATH];
+ wchar_t path[2 * MAX_PATH];
HMODULE hXStatusIconsDLL;
// get miranda's exe path
@@ -851,12 +851,12 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) HGENMENU hRoot;
{
- TCHAR szItem[MAX_PATH + 64];
+ wchar_t szItem[MAX_PATH + 64];
mir_sntprintf(szItem, TranslateT("%s Custom Status"), m_tszUserName);
CMenuItem mi;
mi.root = pcli->pfnGetProtocolMenu(m_szModuleName);
- mi.name.t = szItem;
+ mi.name.w = szItem;
mi.position = 10001;
hRoot = Menu_AddStatusMenuItem(&mi, m_szModuleName);
}
@@ -889,12 +889,12 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) void InitXStatusIcons()
{
- TCHAR lib[2 * MAX_PATH] = { 0 };
+ wchar_t lib[2 * MAX_PATH] = { 0 };
SKINICONDESC sid = { 0 };
sid.section.a = "Protocols/" ICQ_PROTOCOL_NAME "/" LPGEN("Custom Status");
sid.flags = SIDF_PATH_TCHAR;
- sid.defaultFile.t = InitXStatusIconLibrary(lib, _countof(lib));
+ sid.defaultFile.w = InitXStatusIconLibrary(lib, _countof(lib));
for (int i = 0; i < XSTATUS_COUNT; i++) {
char szTemp[100];
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index 268904a0a1..a2c40d3b83 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -66,7 +66,7 @@ static int LookupDatabaseSetting(const FieldNamesItem* table, int code, DBVARIAN }
else if (type == DBVT_WCHAR) {
WCHAR* wtext = make_unicode_string(text);
- dbv->pwszVal = mir_wstrdup(TranslateW(wtext));
+ dbv->pwszVal = mir_wstrdup(TranslateTS(wtext));
dbv->type = DBVT_WCHAR;
SAFE_FREE((void**)&wtext);
}
@@ -348,7 +348,7 @@ INT_PTR CIcqProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam) int dwPaFormat = getByte(pai->hContact, "AvatarType", PA_FORMAT_UNKNOWN);
if (dwPaFormat != PA_FORMAT_UNKNOWN) { // we know the format, test file
- TCHAR tszFile[MAX_PATH * 2 + 4];
+ wchar_t tszFile[MAX_PATH * 2 + 4];
GetFullAvatarFileName(dwUIN, szUID, dwPaFormat, tszFile, MAX_PATH * 2);
@@ -356,7 +356,7 @@ INT_PTR CIcqProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam) pai->format = dwPaFormat;
if (!IsAvatarChanged(pai->hContact, dbv.pbVal, dbv.cpbVal)) { // hashes are the same
- if (_taccess(tszFile, 0) == 0) {
+ if (_waccess(tszFile, 0) == 0) {
db_free(&dbv);
return GAIR_SUCCESS; // we have found the avatar file, whoala
@@ -366,7 +366,7 @@ INT_PTR CIcqProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam) if (IsAvatarChanged(pai->hContact, dbv.pbVal, dbv.cpbVal)) { // we didn't received the avatar before - this ensures we will not request avatar again and again
if ((wParam & GAIF_FORCE) != 0 && pai->hContact != 0) { // request avatar data
- TCHAR tszFile[MAX_PATH * 2 + 4];
+ wchar_t tszFile[MAX_PATH * 2 + 4];
GetAvatarFileName(dwUIN, szUID, tszFile, MAX_PATH * 2);
GetAvatarData(pai->hContact, dwUIN, szUID, dbv.pbVal, dbv.cpbVal, tszFile);
@@ -389,9 +389,9 @@ INT_PTR CIcqProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) if (!wParam) return -3;
- TCHAR *tszFile = GetOwnAvatarFileName();
- if (tszFile && !_taccess(tszFile, 0)) {
- _tcsncpy((TCHAR*)wParam, tszFile, (int)lParam);
+ wchar_t *tszFile = GetOwnAvatarFileName();
+ if (tszFile && !_waccess(tszFile, 0)) {
+ wcsncpy((wchar_t*)wParam, tszFile, (int)lParam);
SAFE_FREE(&tszFile);
return 0;
}
@@ -485,7 +485,7 @@ INT_PTR CIcqProto::SetMyAvatar(WPARAM, LPARAM lParam) if (!m_bAvatarsEnabled || !m_bSsiEnabled)
return -2;
- TCHAR *tszFile = (TCHAR*)lParam;
+ wchar_t *tszFile = (wchar_t*)lParam;
if (tszFile) { // set file for avatar
int dwPaFormat = ::ProtoGetAvatarFileFormat(tszFile);
if (dwPaFormat != PA_FORMAT_XML) {
@@ -497,7 +497,7 @@ INT_PTR CIcqProto::SetMyAvatar(WPARAM, LPARAM lParam) DeleteObject(avt);
}
- TCHAR tszMyFile[MAX_PATH + 1];
+ wchar_t tszMyFile[MAX_PATH + 1];
GetFullAvatarFileName(0, NULL, dwPaFormat, tszMyFile, MAX_PATH);
// if not in our storage, copy
@@ -522,7 +522,7 @@ INT_PTR CIcqProto::SetMyAvatar(WPARAM, LPARAM lParam) if (setSettingBlob(NULL, "AvatarHash", ihash, 0x14))
debugLogA("Failed to save avatar hash.");
- TCHAR tmp[MAX_PATH];
+ wchar_t tmp[MAX_PATH];
PathToRelativeT(tszMyFile, tmp);
setTString(NULL, "AvatarFile", tmp);
SAFE_FREE((void**)&hash);
@@ -668,7 +668,7 @@ INT_PTR icq_getEventTextMissedMessage(WPARAM, LPARAM lParam) MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, pszText, (int)mir_strlen(pszText), pwszText, wchars);
- nRetVal = (INT_PTR)mir_wstrdup(TranslateW(pwszText));
+ nRetVal = (INT_PTR)mir_wstrdup(TranslateTS(pwszText));
}
else if (pEvent->datatype == DBVT_ASCIIZ)
nRetVal = (INT_PTR)mir_strdup(Translate(pszText));
diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp index 59794f946a..f45334019b 100644 --- a/protocols/IcqOscarJ/src/init.cpp +++ b/protocols/IcqOscarJ/src/init.cpp @@ -65,7 +65,7 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) /////////////////////////////////////////////////////////////////////////////////////////
-static PROTO_INTERFACE* icqProtoInit(const char* pszProtoName, const TCHAR* tszUserName)
+static PROTO_INTERFACE* icqProtoInit(const char* pszProtoName, const wchar_t* tszUserName)
{
CIcqProto *ppro = new CIcqProto(pszProtoName, tszUserName);
g_Instances.insert(ppro);
diff --git a/protocols/IcqOscarJ/src/log.cpp b/protocols/IcqOscarJ/src/log.cpp index ee39798610..2556a1aa64 100644 --- a/protocols/IcqOscarJ/src/log.cpp +++ b/protocols/IcqOscarJ/src/log.cpp @@ -119,7 +119,7 @@ void CIcqProto::icq_LogUsingErrorCode(int level, DWORD dwError, const char *szMs break;
default:
- TCHAR err[512];
+ wchar_t err[512];
if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError, 0, err, _countof(err), NULL)) {
pszErrorMsg = make_utf8_string(err);
bNeedFree = TRUE;
diff --git a/protocols/IcqOscarJ/src/loginpassword.cpp b/protocols/IcqOscarJ/src/loginpassword.cpp index 02cfbbd7eb..253bb1b843 100644 --- a/protocols/IcqOscarJ/src/loginpassword.cpp +++ b/protocols/IcqOscarJ/src/loginpassword.cpp @@ -40,7 +40,7 @@ INT_PTR CALLBACK LoginPasswdDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA {
DWORD dwUin = ppro->getContactUin(NULL);
- TCHAR pszUIN[MAX_PATH];
+ wchar_t pszUIN[MAX_PATH];
mir_sntprintf(pszUIN, TranslateT("Enter a password for UIN %u:"), dwUin);
SetDlgItemText(hwndDlg, IDC_INSTRUCTION, pszUIN);
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp index 143a1e715e..be3dae1b0d 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp @@ -497,18 +497,18 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, size_t wLen, DWORD dwUin, char * mir_strcpy(szBlob + sizeof(DWORD), pszFileName);
mir_strcpy(szBlob + sizeof(DWORD) + mir_strlen(pszFileName) + 1, pszDescription);
- TCHAR* ptszFileName = mir_utf8decodeT(pszFileName);
+ wchar_t* ptszFileName = mir_utf8decodeT(pszFileName);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.t = mir_utf8decodeT(pszDescription);
- pre.files.t = &ptszFileName;
+ pre.descr.w = mir_utf8decodeT(pszDescription);
+ pre.files.w = &ptszFileName;
pre.lParam = (LPARAM)ft;
ProtoChainRecvFile(ft->hContact, &pre);
- mir_free(pre.descr.t);
+ mir_free(pre.descr.w);
mir_free(ptszFileName);
}
else if (wAckType == 2) { // First attempt failed, reverse requested
@@ -713,7 +713,7 @@ static char* oftGetFileContainer(oscar_filetransfer* oft, const char** files, in }
-HANDLE CIcqProto::oftInitTransfer(MCONTACT hContact, DWORD dwUin, char* szUid, const TCHAR** files, const TCHAR* pszDesc)
+HANDLE CIcqProto::oftInitTransfer(MCONTACT hContact, DWORD dwUin, char* szUid, const wchar_t** files, const wchar_t* pszDesc)
{
int i, filesCount;
struct _stati64 statbuf;
@@ -728,7 +728,7 @@ HANDLE CIcqProto::oftInitTransfer(MCONTACT hContact, DWORD dwUin, char* szUid, c for (filesCount = 0; files[filesCount]; filesCount++);
ft->files = (oft_file_record *)SAFE_MALLOC(sizeof(oft_file_record) * filesCount);
- ft->files_list = (char**)SAFE_MALLOC(sizeof(TCHAR *) * filesCount);
+ ft->files_list = (char**)SAFE_MALLOC(sizeof(wchar_t *) * filesCount);
ft->qwTotalSize = 0;
char **filesUtf = (char**)SAFE_MALLOC(sizeof(char *) * filesCount);
@@ -736,7 +736,7 @@ HANDLE CIcqProto::oftInitTransfer(MCONTACT hContact, DWORD dwUin, char* szUid, c // Prepare files arrays
for (i = 0; i < filesCount; i++) {
- if (_tstati64(files[i], &statbuf))
+ if (_wstat64(files[i], &statbuf))
debugLogA("IcqSendFile() was passed invalid filename \"%s\"", files[i]);
else {
if (!(statbuf.st_mode & _S_IFDIR)) { // take only files
@@ -854,7 +854,7 @@ HANDLE CIcqProto::oftInitTransfer(MCONTACT hContact, DWORD dwUin, char* szUid, c }
-HANDLE CIcqProto::oftFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR *szPath)
+HANDLE CIcqProto::oftFileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath)
{
oscar_filetransfer *ft = (oscar_filetransfer*)hTransfer;
@@ -884,7 +884,7 @@ HANDLE CIcqProto::oftFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR return hTransfer; // Success
}
-DWORD CIcqProto::oftFileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR*)
+DWORD CIcqProto::oftFileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t*)
{
oscar_filetransfer *ft = (oscar_filetransfer*)hTransfer;
@@ -935,7 +935,7 @@ DWORD CIcqProto::oftFileCancel(MCONTACT hContact, HANDLE hTransfer) return 0; // Success
}
-void CIcqProto::oftFileResume(oscar_filetransfer *ft, int action, const TCHAR *szFilename)
+void CIcqProto::oftFileResume(oscar_filetransfer *ft, int action, const wchar_t *szFilename)
{
int openFlags;
diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp index 108c482721..8a66eeb085 100644 --- a/protocols/IcqOscarJ/src/stdpackets.cpp +++ b/protocols/IcqOscarJ/src/stdpackets.cpp @@ -1547,7 +1547,7 @@ void CIcqProto::icq_sendAuthReqServ(DWORD dwUin, char *szUid, const char *szMsg) sendServPacket(&packet);
}
-void CIcqProto::icq_sendAuthResponseServ(DWORD dwUin, char* szUid, int auth, const TCHAR *szReason)
+void CIcqProto::icq_sendAuthResponseServ(DWORD dwUin, char* szUid, int auth, const wchar_t *szReason)
{
BYTE nUinLen = getUIDLen(dwUin, szUid);
diff --git a/protocols/IcqOscarJ/src/userinfotab.cpp b/protocols/IcqOscarJ/src/userinfotab.cpp index 75d2c8c054..207ff0fe32 100644 --- a/protocols/IcqOscarJ/src/userinfotab.cpp +++ b/protocols/IcqOscarJ/src/userinfotab.cpp @@ -273,14 +273,14 @@ int CIcqProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) odp.dwInitParam = LPARAM(this);
odp.pfnDlgProc = IcqDlgProc;
odp.position = -1900000000;
- odp.ptszTitle = m_tszUserName;
+ odp.pwszTitle = m_tszUserName;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_ICQ);
UserInfo_AddPage(wParam, &odp);
if (!lParam) {
- TCHAR buf[200];
+ wchar_t buf[200];
mir_sntprintf(buf, TranslateT("%s Details"), m_tszUserName);
- odp.ptszTitle = buf;
+ odp.pwszTitle = buf;
odp.position = -1899999999;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_CHANGEINFO);
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index 85a3c36114..3e13e9efe1 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -570,7 +570,7 @@ char* NickFromHandleUtf(MCONTACT hContact) if (hContact == INVALID_CONTACT_ID)
return ICQTranslateUtf(LPGEN("<invalid>"));
- return tchar_to_utf8((TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0));
+ return tchar_to_utf8((wchar_t*)pcli->pfnGetContactDisplayName(hContact, 0));
}
char* strUID(DWORD dwUIN, char *pszUID)
@@ -1443,7 +1443,7 @@ char* __fastcall ICQTranslateUtf(const char *src) { // we can use unicode translate (0.5+)
WCHAR* usrc = make_unicode_string(src);
- szRes = make_utf8_string(TranslateW(usrc));
+ szRes = make_utf8_string(TranslateTS(usrc));
SAFE_FREE((void**)&usrc);
}
@@ -1455,7 +1455,7 @@ char* __fastcall ICQTranslateUtfStatic(const char *src, char *buf, size_t bufsiz if (mir_strlen(src)) { // we can use unicode translate (0.5+)
WCHAR *usrc = make_unicode_string(src);
- make_utf8_string_static(TranslateW(usrc), buf, bufsize);
+ make_utf8_string_static(TranslateTS(usrc), buf, bufsize);
SAFE_FREE((void**)&usrc);
}
@@ -1541,7 +1541,7 @@ const char* ExtractFileName(const char *fullname) }
-char* FileNameToUtf(const TCHAR *filename)
+char* FileNameToUtf(const wchar_t *filename)
{
WCHAR *usFileName = NULL;
int wchars = GetLongPathName(filename, usFileName, 0);
@@ -1555,10 +1555,10 @@ char* FileNameToUtf(const TCHAR *filename) int FileAccessUtf(const char *path, int mode)
{
size_t size = mir_strlen(path) + 2;
- TCHAR *szPath = (TCHAR*)_alloca(size * sizeof(TCHAR));
+ wchar_t *szPath = (wchar_t*)_alloca(size * sizeof(wchar_t));
if (utf8_to_tchar_static(path, szPath, size))
- return _taccess(szPath, mode);
+ return _waccess(szPath, mode);
return -1;
}
@@ -1567,10 +1567,10 @@ int FileAccessUtf(const char *path, int mode) int FileStatUtf(const char *path, struct _stati64 *buffer)
{
size_t size = mir_strlen(path) + 2;
- TCHAR *szPath = (TCHAR*)_alloca(size * sizeof(TCHAR));
+ wchar_t *szPath = (wchar_t*)_alloca(size * sizeof(wchar_t));
if (utf8_to_tchar_static(path, szPath, size))
- return _tstati64(szPath, buffer);
+ return _wstat64(szPath, buffer);
return -1;
}
@@ -1580,10 +1580,10 @@ int MakeDirUtf(const char *dir) {
int wRes = -1;
size_t size = mir_strlen(dir) + 2;
- TCHAR *szDir = (TCHAR*)_alloca(size * sizeof(TCHAR));
+ wchar_t *szDir = (wchar_t*)_alloca(size * sizeof(wchar_t));
- if (utf8_to_tchar_static(dir, szDir, size)) { // _tmkdir can created only one dir at once
- wRes = _tmkdir(szDir);
+ if (utf8_to_tchar_static(dir, szDir, size)) { // _wmkdir can created only one dir at once
+ wRes = _wmkdir(szDir);
// check if dir not already existed - return success if yes
if (wRes == -1 && errno == 17 /* EEXIST */)
wRes = 0;
@@ -1595,7 +1595,7 @@ int MakeDirUtf(const char *dir) *szLast = '\0';
if (!MakeDirUtf(dir))
- wRes = _tmkdir(szDir);
+ wRes = _wmkdir(szDir);
*szLast = cOld;
}
@@ -1609,10 +1609,10 @@ int MakeDirUtf(const char *dir) int OpenFileUtf(const char *filename, int oflag, int pmode)
{
size_t size = mir_strlen(filename) + 2;
- TCHAR *szFile = (TCHAR*)_alloca(size * sizeof(TCHAR));
+ wchar_t *szFile = (wchar_t*)_alloca(size * sizeof(wchar_t));
if (utf8_to_tchar_static(filename, szFile, size))
- return _topen(szFile, oflag, pmode);
+ return _wopen(szFile, oflag, pmode);
return -1;
}
@@ -1636,7 +1636,7 @@ void SetWindowTextUcs(HWND hWnd, WCHAR *text) char* GetWindowTextUtf(HWND hWnd)
{
int nLen = GetWindowTextLength(hWnd);
- TCHAR *szText = (TCHAR*)_alloca((nLen + 2) * sizeof(TCHAR));
+ wchar_t *szText = (wchar_t*)_alloca((nLen + 2) * sizeof(wchar_t));
GetWindowText(hWnd, szText, nLen + 1);
@@ -1653,7 +1653,7 @@ char* GetDlgItemTextUtf(HWND hwndDlg, int iItem) void SetWindowTextUtf(HWND hWnd, const char *szText)
{
size_t size = mir_strlen(szText) + 2;
- TCHAR *tszText = (TCHAR*)_alloca(size * sizeof(TCHAR));
+ wchar_t *tszText = (wchar_t*)_alloca(size * sizeof(wchar_t));
if (utf8_to_tchar_static(szText, tszText, size))
SetWindowText(hWnd, tszText);
diff --git a/protocols/IcqOscarJ/src/utilities.h b/protocols/IcqOscarJ/src/utilities.h index 783ff2fea7..119ebe79eb 100644 --- a/protocols/IcqOscarJ/src/utilities.h +++ b/protocols/IcqOscarJ/src/utilities.h @@ -108,7 +108,7 @@ WORD GetMyStatusFlags(); int IsValidRelativePath(const char *filename);
LPCSTR ExtractFileName(const char *fullname);
-char* FileNameToUtf(const TCHAR *filename);
+char* FileNameToUtf(const wchar_t *filename);
int FileAccessUtf(const char *path, int mode);
int FileStatUtf(const char *path, struct _stati64 *buffer);
|