diff options
182 files changed, 749 insertions, 813 deletions
diff --git a/include/m_database.h b/include/m_database.h index 3bec61cb65..c67ee25475 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -151,7 +151,6 @@ typedef struct struct {
union {
char *pszVal;
- wchar_t *ptszVal;
wchar_t *pwszVal;
};
WORD cchVal; //only used for db/contact/getsettingstatic
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index 1823bdef10..79ccc1ddbe 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -148,7 +148,7 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node, AVATARCACHEENTRY *ace) DBVARIANT dbv = { 0 };
if (!db_get_s(hContact, szProto, "AvatarHash", &dbv)) {
if (dbv.type == DBVT_WCHAR)
- wcsncpy_s(cacn.hash, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(cacn.hash, dbv.pwszVal, _TRUNCATE);
else if (dbv.type == DBVT_ASCIIZ)
wcsncpy_s(cacn.hash, _A2T(dbv.pszVal), _TRUNCATE);
else if (dbv.type == DBVT_BLOB) {
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index ac7f841cf1..2558fe9626 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -387,12 +387,12 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar if (g_selectedProto) { DBVARIANT dbv; if (!db_get_ws(NULL, PPICT_MODULE, g_selectedProto->szProtoname, &dbv)) { - if (!PathIsAbsoluteW(VARSW(dbv.ptszVal))) { + if (!PathIsAbsoluteW(VARSW(dbv.pwszVal))) { wchar_t szFinalPath[MAX_PATH]; - mir_snwprintf(szFinalPath, L"%%miranda_path%%\\%s", dbv.ptszVal); + mir_snwprintf(szFinalPath, L"%%miranda_path%%\\%s", dbv.pwszVal); SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, szFinalPath); } - else SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, dbv.ptszVal); + else SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, dbv.pwszVal); InvalidateRect(GetDlgItem(hwndDlg, IDC_PROTOPIC), nullptr, TRUE); db_free(&dbv); @@ -578,7 +578,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA if (MessageBox(nullptr, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) { DBVARIANT dbv = { 0 }; if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { - DeleteFile(dbv.ptszVal); + DeleteFile(dbv.pwszVal); db_free(&dbv); } } @@ -603,7 +603,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA DBVARIANT dbv = { 0 }; ProtectAvatar(hContact, 0); if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { - DeleteFile(dbv.ptszVal); + DeleteFile(dbv.pwszVal); db_free(&dbv); } } @@ -667,15 +667,15 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA szFinalName[0] = 0; if (is_locked && !db_get_ws(hContact, "ContactPhoto", "Backup", &dbv)) { - MyPathToAbsolute(dbv.ptszVal, szFinalName); + MyPathToAbsolute(dbv.pwszVal, szFinalName); db_free(&dbv); } else if (!db_get_ws(hContact, "ContactPhoto", "RFile", &dbv)) { - MyPathToAbsolute(dbv.ptszVal, szFinalName); + MyPathToAbsolute(dbv.pwszVal, szFinalName); db_free(&dbv); } else if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { - MyPathToAbsolute(dbv.ptszVal, szFinalName); + MyPathToAbsolute(dbv.pwszVal, szFinalName); db_free(&dbv); } szFinalName[MAX_PATH - 1] = 0; @@ -822,7 +822,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa if (MessageBox(nullptr, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) { DBVARIANT dbv = { 0 }; if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { - DeleteFile(dbv.ptszVal); + DeleteFile(dbv.pwszVal); db_free(&dbv); } } @@ -846,7 +846,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa if (MessageBox(nullptr, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) { DBVARIANT dbv = { 0 }; if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) { - DeleteFile(dbv.ptszVal); + DeleteFile(dbv.pwszVal); db_free(&dbv); } } diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index 9ecca88089..2c809a53d0 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -432,7 +432,7 @@ void DeleteGlobalUserAvatar() return;
wchar_t szFilename[MAX_PATH];
- MyPathToAbsolute(dbv.ptszVal, szFilename);
+ MyPathToAbsolute(dbv.pwszVal, szFilename);
db_free(&dbv);
DeleteFile(szFilename);
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp index eabf7ad40d..37623ee409 100755 --- a/plugins/Alarms/src/alarmlist.cpp +++ b/plugins/Alarms/src/alarmlist.cpp @@ -244,12 +244,12 @@ void LoadAlarms() mir_snprintf(buff, "Title%d", i);
if (!db_get_ws(0, MODULENAME, buff, &dbv)) {
- alarm.szTitle = mir_wstrdup(dbv.ptszVal);
+ alarm.szTitle = mir_wstrdup(dbv.pwszVal);
db_free(&dbv);
}
mir_snprintf(buff, "Desc%d", i);
if (!db_get_ws(0, MODULENAME, buff, &dbv)) {
- alarm.szDesc = mir_wstrdup(dbv.ptszVal);
+ alarm.szDesc = mir_wstrdup(dbv.pwszVal);
db_free(&dbv);
}
mir_snprintf(buff, "Occ%d", i);
@@ -302,11 +302,11 @@ void LoadAlarms() if (alarm.action & AAF_COMMAND) {
mir_snprintf(buff, "ActionCommand%d", i);
if (!db_get_ws(0, MODULENAME, buff, &dbv)) {
- alarm.szCommand = mir_wstrdup(dbv.ptszVal);
+ alarm.szCommand = mir_wstrdup(dbv.pwszVal);
db_free(&dbv);
mir_snprintf(buff, "ActionParams%d", i);
if (!db_get_ws(0, MODULENAME, buff, &dbv)) {
- alarm.szCommandParams = mir_wstrdup(dbv.ptszVal);
+ alarm.szCommandParams = mir_wstrdup(dbv.pwszVal);
db_free(&dbv);
}
}
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index 85e68ee111..edda1f5a23 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -133,9 +133,8 @@ void CleanupMimeTypeAddedSettings(void) if (p == nullptr) { // mime type not in current list
DBVARIANT dbv;
- if (!db_get(NULL, MODULENAME, ppszSettings[i], &dbv)) {
- if (dbv.type == DBVT_ASCIIZ)
- RemoveRegMimeType(pszSuffix, dbv.pszVal);
+ if (!db_get_s(NULL, MODULENAME, ppszSettings[i], &dbv)) {
+ RemoveRegMimeType(pszSuffix, dbv.pszVal);
db_free(&dbv);
}
db_unset(NULL, MODULENAME, ppszSettings[i]);
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 3e59a08882..3109286671 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -123,8 +123,8 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L {
DBVARIANT dbv;
if (!db_get_ws(NULL, MODULENAME, "Message", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_EDIT_MESSAGE, dbv.ptszVal);
- mir_free(dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_EDIT_MESSAGE, dbv.pwszVal);
+ mir_free(dbv.pwszVal);
}
}
/* cpuusage threshold */
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index fbd2987e8b..529954f758 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -100,11 +100,11 @@ static int MsgEventAdded(WPARAM, LPARAM hDbEvent) if (dbe.eventType == EVENTTYPE_MESSAGE && !(dbe.flags & DBEF_SENT)) {
DBVARIANT dbv;
if (!db_get_ws(NULL, MODULENAME, "Message", &dbv)) {
- TrimString(dbv.ptszVal);
+ TrimString(dbv.pwszVal);
wchar_t *pszMsg = GetMessageText(&dbe.pBlob, &dbe.cbBlob);
- if (pszMsg != nullptr && wcsstr(pszMsg, dbv.ptszVal) != nullptr)
+ if (pszMsg != nullptr && wcsstr(pszMsg, dbv.pwszVal) != nullptr)
ShutdownAndStopWatcher(); /* msg with specified text recvd */
- mir_free(dbv.ptszVal); /* does NULL check */
+ mir_free(dbv.pwszVal); /* does NULL check */
}
}
mir_free(dbe.pBlob);
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 01b4e143a2..3cd569c8ce 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -542,7 +542,7 @@ int ShowSaveDialog(HWND hwnd, wchar_t* fn, MCONTACT hContact) DBVARIANT dbvInitDir = { 0 };
if (!db_get_ws(hContact, MODULENAME, "SavedAvatarFolder", &dbvInitDir)) {
- ofn.lpstrInitialDir = dbvInitDir.ptszVal;
+ ofn.lpstrInitialDir = dbvInitDir.pwszVal;
db_free(&dbvInitDir);
}
else ofn.lpstrInitialDir = L".";
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index 27e525a38c..d15b8062bb 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -109,7 +109,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) CONTACTAVATARCHANGEDNOTIFICATION* avatar = (CONTACTAVATARCHANGEDNOTIFICATION*)lParam;
if (avatar == nullptr) {
- if (!ret || !mir_wstrcmp(dbvOldHash.ptszVal, L"-")) {
+ if (!ret || !mir_wstrcmp(dbvOldHash.pwszVal, L"-")) {
//avoid duplicate "removed avatar" notifications
//do not notify on an empty profile
ShowDebugPopup(hContact, L"AVH Debug", L"Removed avatar, no avatar before... skipping");
@@ -125,7 +125,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) ShowPopup(hContact, nullptr, opts.popup_removed);
}
else {
- if (ret && !mir_wstrcmp(dbvOldHash.ptszVal, avatar->hash)) {
+ if (ret && !mir_wstrcmp(dbvOldHash.pwszVal, avatar->hash)) {
// same avatar hash, skipping
ShowDebugPopup(hContact, L"AVH Debug", L"Hashes are the same... skipping");
db_free(&dbvOldHash);
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index 9a16069332..2d2eb55ff0 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -490,7 +490,7 @@ void LoadBassLibrary(const wchar_t *ptszPath) BASS_DEVICEINFO info;
if (!db_get_ws(NULL, MODULENAME, OPT_OUTDEVICE, &dbv))
for (size_t i = 1; BASS_GetDeviceInfo((DWORD)i, &info); i++)
- if (!mir_wstrcmp(dbv.ptszVal, _A2T(info.name)))
+ if (!mir_wstrcmp(dbv.pwszVal, _A2T(info.name)))
device = (int)i;
db_free(&dbv);
@@ -544,7 +544,7 @@ int OnModulesLoaded(WPARAM, LPARAM) db_set_ws(NULL, MODULENAME, OPT_BASSPATH, CurrBassPath);
}
else {
- mir_wstrcpy(CurrBassPath, dbv.ptszVal);
+ mir_wstrcpy(CurrBassPath, dbv.pwszVal);
db_free(&dbv);
}
}
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index 7981210cc9..da971082be 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -662,22 +662,22 @@ void Options::LoadTasks() mir_snprintf(buf, "Task_ftpName_%d", i);
DBVARIANT var;
if (!db_get_ws(0, MODULENAME, buf, &var)) {
- to.ftpName = var.ptszVal;
+ to.ftpName = var.pwszVal;
db_free(&var);
}
mir_snprintf(buf, "Task_filterName_%d", i);
if (!db_get_ws(0, MODULENAME, buf, &var)) {
- to.filterName = var.ptszVal;
+ to.filterName = var.pwszVal;
db_free(&var);
}
mir_snprintf(buf, "Task_filePath_%d", i);
if (!db_get_ws(0, MODULENAME, buf, &var)) {
- to.filePath = var.ptszVal;
+ to.filePath = var.pwszVal;
db_free(&var);
}
mir_snprintf(buf, "Task_taskName_%d", i);
if (!db_get_ws(0, MODULENAME, buf, &var)) {
- to.taskName = var.ptszVal;
+ to.taskName = var.pwszVal;
db_free(&var);
}
mir_snprintf(buf, "Task_zipPassword_%d", i);
diff --git a/plugins/Boltun/src/config.cpp b/plugins/Boltun/src/config.cpp index 50cfa462da..314ff43ce1 100644 --- a/plugins/Boltun/src/config.cpp +++ b/plugins/Boltun/src/config.cpp @@ -42,9 +42,9 @@ inline wchar_t* GetString(char* key, const wchar_t* def) wchar_t* val;
if (!db_get_ws(NULL, BOLTUN_KEY, key, &dbv))
{
- size_t len = mir_wstrlen(dbv.ptszVal) + 1;
+ size_t len = mir_wstrlen(dbv.pwszVal) + 1;
val = new wchar_t[len];
- wcscpy_s(val, len, dbv.ptszVal);
+ wcscpy_s(val, len, dbv.pwszVal);
db_free(&dbv);
}
else
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 187e9f1083..54bd9479cf 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -74,15 +74,14 @@ INT_PTR CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam HICON hIcon = nullptr;
UINT uid;
- switch (uMsg){
+ switch (uMsg) {
case WM_INITDIALOG:
g_hDlgPass = hDlg;
hIcon = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_DLGPASSWD));
dwOldIcon = SetClassLongPtr(hDlg, GCLP_HICON, (INT_PTR)hIcon); // set alt+tab icon
SendDlgItemMessage(hDlg, IDC_EDIT1, EM_LIMITTEXT, MAXPASSLEN, 0);
- if (IsAeroMode())
- {
+ if (IsAeroMode()) {
SetWindowLongPtr(hDlg, GWL_STYLE, GetWindowLongPtr(hDlg, GWL_STYLE) | WS_DLGFRAME | WS_SYSMENU);
SetWindowLongPtr(hDlg, GWL_EXSTYLE, GetWindowLongPtr(hDlg, GWL_EXSTYLE) | WS_EX_TOOLWINDOW);
RECT rect;
@@ -111,7 +110,7 @@ INT_PTR CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam case WM_COMMAND:
uid = LOWORD(wParam);
- if (uid == IDOK){
+ if (uid == IDOK) {
char password[MAXPASSLEN + 1] = { 0 };
int passlen = GetDlgItemTextA(hDlg, IDC_EDIT1, password, _countof(password));
if (passlen == 0) {
@@ -148,8 +147,7 @@ INT_PTR CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam static void LanguageChanged(HWND hDlg)
{
HKL LangID = GetKeyboardLayout(0);
- if (LangID != oldLangID)
- {
+ if (LangID != oldLangID) {
char Lang[3] = { 0 };
oldLangID = LangID;
GetLocaleInfoA(MAKELCID((LOWORD(LangID) & 0xffffffff), SORT_DEFAULT), LOCALE_SABBREVLANGNAME, Lang, 2);
@@ -164,8 +162,7 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM) DWORD dwWndPID;
GetWindowThreadProcessId(hWnd, &dwWndPID);
- if ((g_dwMirandaPID == dwWndPID) && hWnd != g_hDlgPass && IsWindowVisible(hWnd))
- {
+ if ((g_dwMirandaPID == dwWndPID) && hWnd != g_hDlgPass && IsWindowVisible(hWnd)) {
wchar_t szTemp[32];
GetClassName(hWnd, szTemp, 32);
@@ -176,8 +173,7 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM) }
else if (mir_wstrcmp(szTemp, L"PopupWnd2") == 0 || mir_wstrcmp(szTemp, L"YAPPWinClass") == 0) // destroy opened popups
PUDeletePopup(hWnd);
- else
- {
+ else {
HWND_ITEM *node = new HWND_ITEM;
node->hWnd = hWnd;
// add to list
@@ -204,8 +200,7 @@ void SetStatus(const char* szProto, unsigned status, wchar_t *tszAwayMsg) static int ChangeAllProtoStatuses(unsigned statusMode, wchar_t *msg)
{
- for (int i = 0; i < protoCount; i++)
- {
+ for (int i = 0; i < protoCount; i++) {
unsigned status = Proto_GetStatus(proto[i]->szModuleName);
if (
(g_wMask & OPT_ONLINEONLY) ? // check "Change only if current status is Online" option
@@ -213,7 +208,7 @@ static int ChangeAllProtoStatuses(unsigned statusMode, wchar_t *msg) :
((status > ID_STATUS_OFFLINE) && (status < ID_STATUS_IDLE) && (status != ID_STATUS_INVISIBLE))) // process all existing statuses except for "invisible" & "offline"
{
- if (g_wMask & OPT_SETONLINEBACK){ // need to save old statuses & status messages
+ if (g_wMask & OPT_SETONLINEBACK) { // need to save old statuses & status messages
oldStatus[i] = status;
if (ProtoServiceExists(proto[i]->szModuleName, PS_GETMYAWAYMSG))
oldStatusMsg[i] = (wchar_t*)CallProtoService(proto[i]->szModuleName, PS_GETMYAWAYMSG, 0, SGMA_UNICODE);
@@ -228,13 +223,10 @@ static int ChangeAllProtoStatuses(unsigned statusMode, wchar_t *msg) static int BackAllProtoStatuses(void)
{
- for (int i = 0; i < protoCount; i++)
- {
- if (oldStatus[i])
- {
+ for (int i = 0; i < protoCount; i++) {
+ if (oldStatus[i]) {
SetStatus(proto[i]->szModuleName, oldStatus[i], oldStatusMsg[i]);
- if (oldStatusMsg[i])
- {
+ if (oldStatusMsg[i]) {
mir_free(oldStatusMsg[i]);
oldStatusMsg[i] = nullptr;
}
@@ -249,7 +241,7 @@ static void CreateTrayIcon(bool create) NOTIFYICONDATA nim;
DBVARIANT dbVar;
if (!db_get_ws(NULL, MOD_NAME, "ToolTipText", &dbVar)) {
- wcsncpy_s(nim.szTip, dbVar.ptszVal, _TRUNCATE);
+ wcsncpy_s(nim.szTip, dbVar.pwszVal, _TRUNCATE);
db_free(&dbVar);
}
else
@@ -285,7 +277,7 @@ static void RestoreOldSettings(void) LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch (uMsg){
+ switch (uMsg) {
case WM_WTSSESSION_CHANGE:
if (wParam == WTS_SESSION_LOCK && g_wMaskAdv & OPT_HIDEIFLOCK && !g_bWindowHidden) // Windows locked
PostMessage(hWnd, WM_USER + 40, 0, 0);
@@ -297,132 +289,125 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara return 0;
case WM_USER + 40: // hide
- {
- if (g_bWindowHidden || g_fOptionsOpen) // already hidden or in options, no hiding
- break;
+ {
+ if (g_bWindowHidden || g_fOptionsOpen) // already hidden or in options, no hiding
+ break;
- DWORD dwWndPID; // remember foreground window
- HWND hForegroundWnd = GetForegroundWindow();
- GetWindowThreadProcessId(hForegroundWnd, &dwWndPID);
- if (g_dwMirandaPID == dwWndPID)
- hOldForegroundWindow = hForegroundWnd;
+ DWORD dwWndPID; // remember foreground window
+ HWND hForegroundWnd = GetForegroundWindow();
+ GetWindowThreadProcessId(hForegroundWnd, &dwWndPID);
+ if (g_dwMirandaPID == dwWndPID)
+ hOldForegroundWindow = hForegroundWnd;
- EnumWindows(EnumWindowsProc, 0);
+ EnumWindows(EnumWindowsProc, 0);
- if (g_wMask & OPT_CHANGESTATUS) // is this even needed?
- {
- BYTE bReqMode = db_get_b(NULL, MOD_NAME, "stattype", 2);
- unsigned uMode = (STATUS_ARR_TO_ID[bReqMode]);
- DBVARIANT dbVar;
- if (g_wMask & OPT_USEDEFMSG || db_get_ws(NULL, MOD_NAME, "statmsg", &dbVar))
- {
- wchar_t *ptszDefMsg = GetDefStatusMsg(uMode, nullptr);
- ChangeAllProtoStatuses(uMode, ptszDefMsg);
- mir_free(ptszDefMsg);
- }
- else
+ if (g_wMask & OPT_CHANGESTATUS) // is this even needed?
{
- if (ServiceExists(MS_VARS_FORMATSTRING))
- {
- wchar_t *ptszParsed = variables_parse(dbVar.ptszVal, nullptr, 0);
- ChangeAllProtoStatuses(uMode, ptszParsed);
- mir_free(ptszParsed);
+ BYTE bReqMode = db_get_b(NULL, MOD_NAME, "stattype", 2);
+ unsigned uMode = (STATUS_ARR_TO_ID[bReqMode]);
+ DBVARIANT dbVar;
+ if (g_wMask & OPT_USEDEFMSG || db_get_ws(NULL, MOD_NAME, "statmsg", &dbVar)) {
+ wchar_t *ptszDefMsg = GetDefStatusMsg(uMode, nullptr);
+ ChangeAllProtoStatuses(uMode, ptszDefMsg);
+ mir_free(ptszDefMsg);
+ }
+ else {
+ if (ServiceExists(MS_VARS_FORMATSTRING)) {
+ wchar_t *ptszParsed = variables_parse(dbVar.pwszVal, nullptr, 0);
+ ChangeAllProtoStatuses(uMode, ptszParsed);
+ mir_free(ptszParsed);
+ }
+ else ChangeAllProtoStatuses(uMode, dbVar.pwszVal);
+
+ db_free(&dbVar);
}
- else
- ChangeAllProtoStatuses(uMode, dbVar.ptszVal);
- db_free(&dbVar);
}
- }
- Clist_TrayIconDestroy(g_clistApi.hwndContactList);
+ Clist_TrayIconDestroy(g_clistApi.hwndContactList);
- if (g_wMask & OPT_TRAYICON)
- CreateTrayIcon(true);
+ if (g_wMask & OPT_TRAYICON)
+ CreateTrayIcon(true);
- // disable popups
- if (CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) == 1)
- {
- // save current
- g_bOldSetting |= OLD_POPUP;
- CallService(MS_POPUP_QUERY, PUQS_DISABLEPOPUPS, 0);
- }
+ // disable popups
+ if (CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) == 1) {
+ // save current
+ g_bOldSetting |= OLD_POPUP;
+ CallService(MS_POPUP_QUERY, PUQS_DISABLEPOPUPS, 0);
+ }
- // disable sounds
- if ((g_wMask & OPT_DISABLESNDS) && db_get_b(NULL, "Skin", "UseSound", 1))
- {
- // save current
- g_bOldSetting |= OLD_SOUND;
- db_set_b(NULL, "Skin", "UseSound", 0);
- }
+ // disable sounds
+ if ((g_wMask & OPT_DISABLESNDS) && db_get_b(NULL, "Skin", "UseSound", 1)) {
+ // save current
+ g_bOldSetting |= OLD_SOUND;
+ db_set_b(NULL, "Skin", "UseSound", 0);
+ }
- g_bWindowHidden = true;
+ g_bWindowHidden = true;
- g_bOldSetting |= OLD_WASHIDDEN;
- db_set_b(NULL, MOD_NAME, "OldSetting", g_bOldSetting);
- }
- return 0;
+ g_bOldSetting |= OLD_WASHIDDEN;
+ db_set_b(NULL, MOD_NAME, "OldSetting", g_bOldSetting);
+ }
+ return 0;
case WM_USER + 52: // back
- {
- if (!g_bWindowHidden || g_fPassRequested)
- break;
+ {
+ if (!g_bWindowHidden || g_fPassRequested)
+ break;
- if (g_wMask & OPT_REQPASS){ //password request
- DBVARIANT dbVar;
- if (!db_get_s(NULL, MOD_NAME, "password", &dbVar)) {
- g_fPassRequested = true;
+ if (g_wMask & OPT_REQPASS) { //password request
+ DBVARIANT dbVar;
+ if (!db_get_s(NULL, MOD_NAME, "password", &dbVar)) {
+ g_fPassRequested = true;
- strncpy(g_password, dbVar.pszVal, MAXPASSLEN);
- db_free(&dbVar);
+ strncpy(g_password, dbVar.pszVal, MAXPASSLEN);
+ db_free(&dbVar);
- int res = DialogBox(g_plugin.getInst(), (MAKEINTRESOURCE(IDD_PASSDIALOGNEW)), GetForegroundWindow(), DlgStdInProc);
+ int res = DialogBox(g_plugin.getInst(), (MAKEINTRESOURCE(IDD_PASSDIALOGNEW)), GetForegroundWindow(), DlgStdInProc);
- g_fPassRequested = false;
- if (res != IDOK) return 0;
+ g_fPassRequested = false;
+ if (res != IDOK) return 0;
+ }
}
- }
- if (g_wMask & OPT_CHANGESTATUS && g_wMask & OPT_SETONLINEBACK) // set back to some status
- BackAllProtoStatuses();
+ if (g_wMask & OPT_CHANGESTATUS && g_wMask & OPT_SETONLINEBACK) // set back to some status
+ BackAllProtoStatuses();
- HWND_ITEM *pCurWnd = g_pMirWnds;
- while (pCurWnd != nullptr)
- {
- HWND_ITEM *pNextWnd = pCurWnd->next;
- wchar_t szTemp[32];
- GetClassName(pCurWnd->hWnd, szTemp, 32);
+ HWND_ITEM *pCurWnd = g_pMirWnds;
+ while (pCurWnd != nullptr) {
+ HWND_ITEM *pNextWnd = pCurWnd->next;
+ wchar_t szTemp[32];
+ GetClassName(pCurWnd->hWnd, szTemp, 32);
- if (IsWindow(pCurWnd->hWnd) && mir_wstrcmp(szTemp, L"SysShadow") != 0) // precaution
- ShowWindow(pCurWnd->hWnd, SW_SHOW);
+ if (IsWindow(pCurWnd->hWnd) && mir_wstrcmp(szTemp, L"SysShadow") != 0) // precaution
+ ShowWindow(pCurWnd->hWnd, SW_SHOW);
- delete pCurWnd; // bye-bye
- pCurWnd = pNextWnd; // traverse to next item
- }
- g_pMirWnds = nullptr;
+ delete pCurWnd; // bye-bye
+ pCurWnd = pNextWnd; // traverse to next item
+ }
+ g_pMirWnds = nullptr;
- if (hOldForegroundWindow)
- {
- SetForegroundWindow(hOldForegroundWindow);
- hOldForegroundWindow = nullptr;
- }
+ if (hOldForegroundWindow) {
+ SetForegroundWindow(hOldForegroundWindow);
+ hOldForegroundWindow = nullptr;
+ }
- RestoreOldSettings();
+ RestoreOldSettings();
- if (g_TrayIcon) CreateTrayIcon(false);
+ if (g_TrayIcon) CreateTrayIcon(false);
- g_clistApi.pfnTrayIconInit(g_clistApi.hwndContactList);
+ g_clistApi.pfnTrayIconInit(g_clistApi.hwndContactList);
- // force a redraw
- // should prevent drawing problems
- InvalidateRect(g_clistApi.hwndContactList, nullptr, true);
- UpdateWindow(g_clistApi.hwndContactList);
+ // force a redraw
+ // should prevent drawing problems
+ InvalidateRect(g_clistApi.hwndContactList, nullptr, true);
+ UpdateWindow(g_clistApi.hwndContactList);
- PostMessage(hWnd, WM_MOUSEMOVE, 0, (LPARAM)MAKELONG(2, 2)); // reset core's IDLE
- g_bWindowHidden = false;
+ PostMessage(hWnd, WM_MOUSEMOVE, 0, (LPARAM)MAKELONG(2, 2)); // reset core's IDLE
+ g_bWindowHidden = false;
- db_set_b(NULL, MOD_NAME, "OldSetting", 0);
- }
- return 0;
+ db_set_b(NULL, MOD_NAME, "OldSetting", 0);
+ }
+ return 0;
}
return(DefWindowProc(hWnd, uMsg, wParam, lParam));
}
@@ -436,8 +421,7 @@ static int MsgWinOpening(WPARAM, LPARAM) // hiding new message windows VOID CALLBACK WinEventProc(HWINEVENTHOOK, DWORD event, HWND hwnd, LONG idObject, LONG, DWORD, DWORD)
{
- if (g_bWindowHidden && idObject == OBJID_WINDOW && (event == EVENT_OBJECT_CREATE || event == EVENT_OBJECT_SHOW) && (IsWindowVisible(hwnd)))
- {
+ if (g_bWindowHidden && idObject == OBJID_WINDOW && (event == EVENT_OBJECT_CREATE || event == EVENT_OBJECT_SHOW) && (IsWindowVisible(hwnd))) {
if (hwnd == g_clistApi.hwndContactList)
ShowWindow(hwnd, SW_HIDE);
else
@@ -456,8 +440,7 @@ static wchar_t *HokeyVkToName(WORD vkKey) static wchar_t buf[32] = { 0 };
DWORD code = MapVirtualKey(vkKey, 0) << 16;
- switch (vkKey)
- {
+ switch (vkKey) {
case 0:
case VK_CONTROL:
case VK_SHIFT:
@@ -607,8 +590,7 @@ static int EnumProtos(WPARAM, LPARAM) oldStatus = new unsigned[protoCount];
oldStatusMsg = new wchar_t*[protoCount];
- for (int i = 0; i < protoCount; i++)
- {
+ for (int i = 0; i < protoCount; i++) {
oldStatus[i] = 0;
oldStatusMsg[i] = nullptr;
}
@@ -639,14 +621,12 @@ static int MirandaLoaded(WPARAM, LPARAM) winclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
winclass.lpszClassName = BOSSKEY_LISTEN_INFO;
- if (RegisterClass(&winclass))
- {
+ if (RegisterClass(&winclass)) {
g_hListenWindow = CreateWindow(BOSSKEY_LISTEN_INFO, BOSSKEY_LISTEN_INFO, WS_POPUP, 0, 0, 5, 5, g_clistApi.hwndContactList, nullptr, g_plugin.getInst(), nullptr);
WTSRegisterSessionNotification(g_hListenWindow, 0);
}
- if (IsWinVerVistaPlus())
- {
+ if (IsWinVerVistaPlus()) {
hDwmApi = LoadLibrary(L"dwmapi.dll");
if (hDwmApi)
dwmIsCompositionEnabled = (PFNDwmIsCompositionEnabled)GetProcAddress(hDwmApi, "DwmIsCompositionEnabled");
@@ -655,8 +635,7 @@ static int MirandaLoaded(WPARAM, LPARAM) BossKeyMenuItemInit();
// Register token for variables plugin
- if (ServiceExists(MS_VARS_REGISTERTOKEN))
- {
+ if (ServiceExists(MS_VARS_REGISTERTOKEN)) {
TOKENREGISTER tr = { 0 };
tr.cbSize = sizeof(TOKENREGISTER);
tr.memType = TR_MEM_OWNER;
@@ -713,8 +692,7 @@ int CMPlugin::Unload() if (g_hWinHook != nullptr)
UnhookWinEvent(g_hWinHook);
- if (g_hListenWindow)
- {
+ if (g_hListenWindow) {
WTSUnRegisterSessionNotification(g_hListenWindow);
DestroyWindow(g_hListenWindow);
}
@@ -724,8 +702,7 @@ int CMPlugin::Unload() // free all sessions
HWND_ITEM *pTemp = g_pMirWnds;
- while (pTemp != nullptr)
- {
+ while (pTemp != nullptr) {
HWND_ITEM *pNext = pTemp->next;
delete pTemp;
pTemp = pNext;
diff --git a/plugins/BossKeyPlus/src/Options.cpp b/plugins/BossKeyPlus/src/Options.cpp index e3133c55c6..46ebb3832a 100644 --- a/plugins/BossKeyPlus/src/Options.cpp +++ b/plugins/BossKeyPlus/src/Options.cpp @@ -124,7 +124,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam DBVARIANT dbVar;
SendDlgItemMessage(hwndDlg, IDC_MAINOPT_STATMSG, EM_LIMITTEXT, 1024, 0);
if (!db_get_ws(NULL, MOD_NAME, "statmsg", &dbVar)) {
- SetDlgItemText(hwndDlg, IDC_MAINOPT_STATMSG, dbVar.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_MAINOPT_STATMSG, dbVar.pwszVal);
db_free(&dbVar);
}
}
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 1e419f8915..68421a0d0b 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -661,15 +661,10 @@ int CMPlugin::Load() HookEvent(ME_DB_CONTACT_ADDED, ContactAdded);
// ensure all contacts are timestamped
- DBVARIANT dbv;
DWORD current_time = (DWORD)time(0);
-
- for (auto &hContact : Contacts()) {
- if (!db_get(hContact, MODULENAME, "CreationTime", &dbv))
- db_free(&dbv);
- else
+ for (auto &hContact : Contacts())
+ if (!db_get_dw(hContact, MODULENAME, "CreationTime"))
db_set_dw(hContact, MODULENAME, "CreationTime", current_time);
- }
g_plugin.registerIcon("BuddyExpectator", iconList);
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp index 727d9107d1..430f6359c5 100644 --- a/plugins/BuddyPounce/src/dialog.cpp +++ b/plugins/BuddyPounce/src/dialog.cpp @@ -66,11 +66,11 @@ void getDefaultMessage(HWND hwnd, UINT control, MCONTACT hContact) {
DBVARIANT dbv;
if (!db_get_ws(hContact, MODULENAME, "PounceMsg", &dbv)) {
- SetDlgItemText(hwnd, control, dbv.ptszVal);
+ SetDlgItemText(hwnd, control, dbv.pwszVal);
db_free(&dbv);
}
else if (!db_get_ws(NULL, MODULENAME, "PounceMsg", &dbv)) {
- SetDlgItemText(hwnd, control, dbv.ptszVal);
+ SetDlgItemText(hwnd, control, dbv.pwszVal);
db_free(&dbv);
}
}
@@ -513,7 +513,7 @@ INT_PTR CALLBACK SendPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (db_get_ws(spdps->hContact, MODULENAME, "PounceMsg", &dbv))
DestroyWindow(hwnd);
else {
- SetDlgItemText(hwnd, IDC_MESSAGE, dbv.ptszVal);
+ SetDlgItemText(hwnd, IDC_MESSAGE, dbv.pwszVal);
db_free(&dbv);
}
}
@@ -570,7 +570,7 @@ INT_PTR CALLBACK PounceSentDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (db_get_ws(hContact, MODULENAME, "PounceMsg", &dbv))
DestroyWindow(hwnd);
else {
- SetDlgItemText(hwnd, IDC_MESSAGE, dbv.ptszVal);
+ SetDlgItemText(hwnd, IDC_MESSAGE, dbv.pwszVal);
db_free(&dbv);
}
}
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index 41853700b2..53e56be61a 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -50,8 +50,8 @@ int MsgAck(WPARAM, LPARAM lParam) DBEVENTINFO dbei = {};
DBVARIANT dbv;
int reuse = db_get_b(ack->hContact, MODULENAME, "Reuse", 0);
- if (!db_get_ws(ack->hContact, MODULENAME, "PounceMsg", &dbv) && (dbv.ptszVal[0] != '\0')) {
- T2Utf pszUtf(dbv.ptszVal);
+ if (!db_get_ws(ack->hContact, MODULENAME, "PounceMsg", &dbv) && (dbv.pwszVal[0] != '\0')) {
+ T2Utf pszUtf(dbv.pwszVal);
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_UTF | DBEF_SENT;
dbei.szModule = (char*)ack->szModule;
@@ -141,7 +141,7 @@ int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) if (newStatus != oldStatus && hContact != NULL && newStatus != ID_STATUS_OFFLINE) {
DBVARIANT dbv;
- if (!db_get_ws(hContact, MODULENAME, "PounceMsg", &dbv) && (dbv.ptszVal[0] != '\0')) {
+ if (!db_get_ws(hContact, MODULENAME, "PounceMsg", &dbv) && (dbv.pwszVal[0] != '\0')) {
// check my status
if (statusCheck(db_get_w(hContact, MODULENAME, "SendIfMyStatusIsFLAG", 0), Proto_GetStatus(szProto))
// check the contacts status
@@ -150,14 +150,14 @@ int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) if (CheckDate(hContact)) {
if (db_get_w(hContact, MODULENAME, "ConfirmTimeout", 0)) {
SendPounceDlgProcStruct *spdps = (SendPounceDlgProcStruct *)mir_alloc(sizeof(SendPounceDlgProcStruct));
- wchar_t *message = mir_wstrdup(dbv.ptszVal); // will get free()ed in the send confirm window proc
+ wchar_t *message = mir_wstrdup(dbv.pwszVal); // will get free()ed in the send confirm window proc
spdps->hContact = hContact;
spdps->message = message;
CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CONFIRMSEND), nullptr, SendPounceDlgProc, (LPARAM)spdps);
// set the confirmation window to send the msg when the timeout is done
mir_free(message);
}
- else SendPounce(dbv.ptszVal, hContact);
+ else SendPounce(dbv.pwszVal, hContact);
}
}
db_free(&dbv);
@@ -196,9 +196,9 @@ INT_PTR AddToPounce(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
if (!db_get_ws(hContact, MODULENAME, "PounceMsg", &dbv))
{
- wchar_t* newPounce = (wchar_t*)mir_alloc(mir_wstrlen(dbv.ptszVal) + mir_wstrlen(message) + 1);
+ wchar_t* newPounce = (wchar_t*)mir_alloc(mir_wstrlen(dbv.pwszVal) + mir_wstrlen(message) + 1);
if (!newPounce) return 1;
- mir_wstrcpy(newPounce, dbv.ptszVal);
+ mir_wstrcpy(newPounce, dbv.pwszVal);
mir_wstrcat(newPounce, message);
db_set_ws(hContact, MODULENAME, "PounceMsg", newPounce);
mir_free(newPounce);
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index 9ca2277552..7d5968db7a 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -234,14 +234,14 @@ void importCustomStatuses(CSWindow* csw, int result) mir_snprintf(bufTitle, "XStatus%dName", i); if (!db_get_ws(NULL, protoName, bufTitle, &dbv)) { - mir_wstrcpy(si->m_tszTitle, dbv.ptszVal); + mir_wstrcpy(si->m_tszTitle, dbv.pwszVal); db_free(&dbv); } else si->m_tszTitle[0] = 0; mir_snprintf(bufMessage, "XStatus%dMsg", i); if (!db_get_ws(NULL, protoName, bufMessage, &dbv)) { - mir_wstrcpy(si->m_tszMessage, dbv.ptszVal); + mir_wstrcpy(si->m_tszMessage, dbv.pwszVal); db_free(&dbv); } else si->m_tszMessage[0] = 0; @@ -720,14 +720,14 @@ void CSItemsList::loadItems(char *protoName) mir_snprintf(dbSetting, "%s_Item%dTitle", protoName, i); if (!getWString(dbSetting, &dbv)) { - mir_wstrcpy(item->m_tszTitle, dbv.ptszVal); + mir_wstrcpy(item->m_tszTitle, dbv.pwszVal); db_free(&dbv); } else item->m_tszTitle[0] = 0; mir_snprintf(dbSetting, "%s_Item%dMessage", protoName, i); if (!getWString(dbSetting, &dbv)) { - mir_wstrcpy(item->m_tszMessage, dbv.ptszVal); + mir_wstrcpy(item->m_tszMessage, dbv.pwszVal); db_free(&dbv); } else item->m_tszMessage[0] = 0; diff --git a/plugins/ClientChangeNotify/src/CString.cpp b/plugins/ClientChangeNotify/src/CString.cpp index 66d5477201..b0396d375e 100644 --- a/plugins/ClientChangeNotify/src/CString.cpp +++ b/plugins/ClientChangeNotify/src/CString.cpp @@ -277,7 +277,7 @@ TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, co TCString Result;
if (!iRes && (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR)) {
- Result = dbv.ptszVal;
+ Result = dbv.pwszVal;
}
else if (dbv.type == DBVT_BYTE || dbv.type == DBVT_WORD || dbv.type == DBVT_DWORD) {
long value = (dbv.type == DBVT_DWORD) ? dbv.dVal : (dbv.type == DBVT_WORD ? dbv.wVal : dbv.bVal);
diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp index a7ede404d9..56043c5bf5 100644 --- a/plugins/Clist_blind/src/cluiopts.cpp +++ b/plugins/Clist_blind/src/cluiopts.cpp @@ -73,7 +73,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L {
DBVARIANT dbv;
if (!db_get_ws(NULL, "CList", "TitleText", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_TITLETEXT, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_TITLETEXT, dbv.pwszVal);
db_free(&dbv);
}
else SetDlgItemTextA(hwndDlg, IDC_TITLETEXT, MIRANDANAME);
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp index 26988949a7..e447ba23f8 100644 --- a/plugins/Clist_modern/src/cluiframes.cpp +++ b/plugins/Clist_modern/src/cluiframes.cpp @@ -608,7 +608,7 @@ static int LocateStorePosition(int Frameid, int maxstored) if (db_get_ws(0, CLUIFrameModule, settingname, &dbv))
continue;
- if (mir_wstrcmpi(dbv.ptszVal, g_pfwFrames[Frameid].name) == 0) {
+ if (mir_wstrcmpi(dbv.pwszVal, g_pfwFrames[Frameid].name) == 0) {
db_free(&dbv);
return i;
}
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 7c8901bf67..c25717b344 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -284,7 +284,7 @@ int GetStatusName(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xstat DBVARIANT dbv = { 0 }; if (!db_get_ws(pdnce->hContact, pdnce->szProto, "XStatusName", &dbv)) { //mir_wstrncpy(text, dbv.pszVal, text_size); - CopySkipUnprintableChars(text, dbv.ptszVal, text_size - 1); + CopySkipUnprintableChars(text, dbv.pwszVal, text_size - 1); db_free(&dbv); if (text[0] != '\0') @@ -303,7 +303,7 @@ int GetStatusName(wchar_t *text, int text_size, ClcCacheEntry *pdnce, BOOL xstat if (!noAwayMsg && !noXstatus && !xstatus_has_priority && pdnce->hContact && pdnce->szProto) { DBVARIANT dbv = { 0 }; if (!db_get_ws(pdnce->hContact, pdnce->szProto, "XStatusName", &dbv)) { - CopySkipUnprintableChars(text, dbv.ptszVal, text_size - 1); + CopySkipUnprintableChars(text, dbv.pwszVal, text_size - 1); db_free(&dbv); if (text[0] != '\0') @@ -479,7 +479,7 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact) DBVARIANT dbv = { 0 }; if (!db_get_ws(pdnce->hContact, pdnce->szProto, "Nick", &dbv)) { wchar_t nick[_countof(contact->szText)]; - mir_wstrncpy(nick, dbv.ptszVal, _countof(contact->szText)); + mir_wstrncpy(nick, dbv.pwszVal, _countof(contact->szText)); db_free(&dbv); // They are the same -> use the name to keep the case diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 3941e09a8f..e7c74bedeb 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -999,7 +999,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP DBVARIANT dbv = { 0 };
wchar_t *s;
if (!db_get_ws(0, "CList", "TitleText", &dbv))
- s = dbv.ptszVal;
+ s = dbv.pwszVal;
else
s = _A2W(MIRANDANAME);
SetDlgItemText(hwndDlg, IDC_TITLETEXT, s);
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index da055263f7..7a17f78610 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -751,7 +751,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM {
DBVARIANT dbv;
if (!db_get_ws(0, "CList", "ThirdLineText", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_VARIABLE_TEXT, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_VARIABLE_TEXT, dbv.pwszVal);
db_free(&dbv);
}
}
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index fea55d6b6d..e820f45321 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -643,7 +643,7 @@ void CLUI_ChangeWindowMode() if (db_get_ws(0, "CList", "TitleText", &dbv))
mir_wstrncpy(titleText, _A2W(MIRANDANAME), _countof(titleText));
else {
- mir_wstrncpy(titleText, dbv.ptszVal, _countof(titleText));
+ mir_wstrncpy(titleText, dbv.pwszVal, _countof(titleText));
db_free(&dbv);
}
SetWindowText(g_clistApi.hwndContactList, titleText);
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index b6e39aec18..a654d615c1 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -1262,12 +1262,12 @@ void ApplyViewMode(const char *Name, bool onlySelector) }
mir_snprintf(szSetting, "%c%s_GF", 246, Name);
if (!db_get_ws(0, CLVM_MODULE, szSetting, &dbv)) {
- if (mir_wstrlen(dbv.ptszVal) >= 2) {
- mir_wstrncpy(g_CluiData.groupFilter, dbv.ptszVal, _countof(g_CluiData.groupFilter));
+ if (mir_wstrlen(dbv.pwszVal) >= 2) {
+ mir_wstrncpy(g_CluiData.groupFilter, dbv.pwszVal, _countof(g_CluiData.groupFilter));
g_CluiData.groupFilter[_countof(g_CluiData.groupFilter) - 1] = 0;
g_CluiData.bFilterEffective |= CLVM_FILTER_GROUPS;
}
- mir_free(dbv.ptszVal);
+ mir_free(dbv.pwszVal);
}
mir_snprintf(szSetting, "%c%s_SM", 246, Name);
g_CluiData.statusMaskFilter = db_get_dw(0, CLVM_MODULE, szSetting, -1);
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 095ba1e2eb..e877201fea 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -162,7 +162,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) DBVARIANT dbv = { 0 };
INT_PTR result = db_get_ws(hContact, "CList", "StatusMsg", &dbv);
- if (!result && mir_wstrlen(dbv.ptszVal) > 0)
+ if (!result && mir_wstrlen(dbv.pwszVal) > 0)
p->bStatusMsgValid = STATUSMSG_CLIST;
else {
if (!szProto)
@@ -170,11 +170,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (szProto) {
if (!result)
db_free(&dbv);
- if (!(result = db_get_ws(hContact, szProto, "YMsg", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
+ if (!(result = db_get_ws(hContact, szProto, "YMsg", &dbv)) && mir_wstrlen(dbv.pwszVal) > 0)
p->bStatusMsgValid = STATUSMSG_YIM;
- else if (!(result = db_get_ws(hContact, szProto, "StatusDescr", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
+ else if (!(result = db_get_ws(hContact, szProto, "StatusDescr", &dbv)) && mir_wstrlen(dbv.pwszVal) > 0)
p->bStatusMsgValid = STATUSMSG_GG;
- else if (!(result = db_get_ws(hContact, szProto, "XStatusMsg", &dbv)) && mir_wstrlen(dbv.ptszVal) > 0)
+ else if (!(result = db_get_ws(hContact, szProto, "XStatusMsg", &dbv)) && mir_wstrlen(dbv.pwszVal) > 0)
p->bStatusMsgValid = STATUSMSG_XSTATUS;
}
}
@@ -183,11 +183,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (!result)
db_free(&dbv);
result = db_get_ws(hContact, szProto, "XStatusName", &dbv);
- if (!result && mir_wstrlen(dbv.ptszVal) > 1) {
- size_t iLen = mir_wstrlen(dbv.ptszVal);
+ if (!result && mir_wstrlen(dbv.pwszVal) > 1) {
+ size_t iLen = mir_wstrlen(dbv.pwszVal);
p->bStatusMsgValid = STATUSMSG_XSTATUSNAME;
p->statusMsg = (wchar_t *)realloc(p->statusMsg, (iLen + 2) * sizeof(wchar_t));
- wcsncpy(p->statusMsg, dbv.ptszVal, iLen + 1);
+ wcsncpy(p->statusMsg, dbv.pwszVal, iLen + 1);
}
else {
int xStatus;
@@ -213,11 +213,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (p->bStatusMsgValid > STATUSMSG_XSTATUSNAME) {
int j = 0;
- p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_wstrlen(dbv.ptszVal) + 2) * sizeof(wchar_t));
- for (int i = 0; dbv.ptszVal[i]; i++) {
- if (dbv.ptszVal[i] == (wchar_t)0x0d)
+ p->statusMsg = (wchar_t *)realloc(p->statusMsg, (mir_wstrlen(dbv.pwszVal) + 2) * sizeof(wchar_t));
+ for (int i = 0; dbv.pwszVal[i]; i++) {
+ if (dbv.pwszVal[i] == (wchar_t)0x0d)
continue;
- p->statusMsg[j] = dbv.ptszVal[i] == (wchar_t)0x0a ? (wchar_t)' ' : dbv.ptszVal[i];
+ p->statusMsg[j] = dbv.pwszVal[i] == (wchar_t)0x0a ? (wchar_t)' ' : dbv.pwszVal[i];
j++;
}
p->statusMsg[j] = 0;
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 87bba912aa..cfb7a37879 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -709,7 +709,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, DBVARIANT dbv;
if (!db_get_ws(NULL, "CLC", "BkBitmap", &dbv)) {
wchar_t szPath[MAX_PATH];
- if (PathToAbsoluteW(dbv.ptszVal, szPath))
+ if (PathToAbsoluteW(dbv.pwszVal, szPath))
SetDlgItemText(hwndDlg, IDC_FILENAME, szPath);
db_free(&dbv);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 341a8134cc..f2ee3b3ae7 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -870,7 +870,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l if (db_get_b(NULL, "CList", "AutoApplyLastViewMode", 0)) { DBVARIANT dbv = { 0 }; - if (!db_get(NULL, "CList", "LastViewMode", &dbv)) { + if (!db_get_s(NULL, "CList", "LastViewMode", &dbv)) { if (mir_strlen(dbv.pszVal) > 2) { if (db_get_dw(NULL, CLVM_MODULE, dbv.pszVal, -1) != 0xffffffff) ApplyViewMode((char *)dbv.pszVal); diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 6b7637a62d..964b91fc4b 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -1188,7 +1188,7 @@ void IMG_LoadItems() return;
wchar_t tszFileName[MAX_PATH];
- MY_pathToAbsolute(dbv.ptszVal, tszFileName);
+ MY_pathToAbsolute(dbv.pwszVal, tszFileName);
// TODO: rewrite the skin loading in wchar_t manner
char szFileName[MAX_PATH];
@@ -1461,7 +1461,7 @@ static void ApplyCLUISkin() wchar_t tszFinalName[MAX_PATH];
char szFinalName[MAX_PATH];
if (!db_get_ws(NULL, "CLC", "AdvancedSkin", &dbv)) {
- MY_pathToAbsolute(dbv.ptszVal, tszFinalName);
+ MY_pathToAbsolute(dbv.pwszVal, tszFinalName);
WideCharToMultiByte(CP_ACP, 0, tszFinalName, MAX_PATH, szFinalName, MAX_PATH, nullptr, nullptr);
@@ -1514,7 +1514,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L Utils::enableDlgControl(hwndDlg, IDC_RELOAD, FALSE);
CheckDlgButton(hwndDlg, IDC_USESKIN, db_get_b(NULL, "CLUI", "useskin", 0) ? BST_CHECKED : BST_UNCHECKED);
if (!db_get_ws(NULL, "CLC", "AdvancedSkin", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_SKINFILENAME, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_SKINFILENAME, dbv.pwszVal);
db_free(&dbv);
}
else
@@ -1565,7 +1565,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L DBVARIANT dbv = { 0 };
if (!db_get_ws(NULL, "CLC", "AdvancedSkin", &dbv)) {
- if (mir_wstrcmp(dbv.ptszVal, final_path))
+ if (mir_wstrcmp(dbv.pwszVal, final_path))
skinChanged = TRUE;
db_free(&dbv);
}
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index bd46542ed9..2951f8d44f 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -430,7 +430,7 @@ void UpdateFilters() }
mir_snprintf(szSetting, "%c%s_PF", 246, szBuf);
- if (db_get(NULL, CLVM_MODULE, szSetting, &dbv_pf))
+ if (db_get_s(NULL, CLVM_MODULE, szSetting, &dbv_pf))
goto cleanup;
mir_snprintf(szSetting, "%c%s_GF", 246, szBuf);
@@ -485,7 +485,7 @@ void UpdateFilters() item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
mir_snwprintf(szMask, L"%s|", szTemp);
- if (dbv_gf.ptszVal && wcsstr(dbv_gf.ptszVal, szMask)) {
+ if (dbv_gf.pwszVal && wcsstr(dbv_gf.pwszVal, szMask)) {
ListView_SetCheckState(hwndList, i, TRUE);
}
else {
diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp index f67d27b198..7fe08815df 100644 --- a/plugins/CmdLine/src/utils.cpp +++ b/plugins/CmdLine/src/utils.cpp @@ -27,10 +27,9 @@ int Info(char *title, char *format, ...) int tBytes;
va_start(vararg, format);
tBytes = mir_vsnprintf(str, sizeof(str), format, vararg);
- if (tBytes > 0)
- {
- str[tBytes] = 0;
- }
+ if (tBytes > 0) {
+ str[tBytes] = 0;
+ }
va_end(vararg);
return MessageBoxA(nullptr, str, title, MB_OK | MB_ICONINFORMATION);
}
@@ -50,92 +49,87 @@ char *BinToHex(int size, PBYTE data) {
char *szresult = nullptr;
int maxSize = size * 2 + HEX_SIZE + 1;
- szresult = (char *) new char[ maxSize ];
+ szresult = (char *) new char[maxSize];
mir_snprintf(szresult, maxSize, "%0*X", HEX_SIZE, size);
return bin2hex(data, size, szresult + HEX_SIZE);
}
void HexToBin(char *inData, ULONG &size, LPBYTE &outData)
{
- char buffer[32] = {0};
+ char buffer[32] = { 0 };
strcpy(buffer, "0x");
strncpy_s(buffer + 2, HEX_SIZE, inData, _TRUNCATE);
sscanf(buffer, "%x", &size);
- outData = (unsigned char*)new char[size*2];
+ outData = (unsigned char*)new char[size * 2];
char *tmp = inData + HEX_SIZE;
buffer[4] = '\0'; //mark the end of the string
for (UINT i = 0; i < size; i++) {
- strncpy_s(buffer + 2, 3, &tmp[i*2], _TRUNCATE);
+ strncpy_s(buffer + 2, 3, &tmp[i * 2], _TRUNCATE);
sscanf(buffer, "%hhx", &outData[i]);
}
}
int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName, char *szError, char *szResult, size_t size)
{
- DBVARIANT dbv = {0};
+ DBVARIANT dbv = { 0 };
int res = 1;
size_t len;
dbv.type = DBVT_ASCIIZ;
- if (db_get(hContact, szModule, szSettingName, &dbv) == 0)
- {
- res = 0;
- size_t tmp = mir_strlen(dbv.pszVal);
+ if (db_get(hContact, szModule, szSettingName, &dbv) == 0) {
+ res = 0;
+ size_t tmp = mir_strlen(dbv.pszVal);
+ len = (tmp < size - 1) ? tmp : size - 1;
+ strncpy(szResult, dbv.pszVal, len);
+ szResult[len] = '\0';
+ mir_free(dbv.pszVal);
+ }
+ else {
+ res = 1;
+ if (szError) {
+ size_t tmp = mir_strlen(szError);
len = (tmp < size - 1) ? tmp : size - 1;
- strncpy(szResult, dbv.pszVal, len);
+ strncpy(szResult, szError, len);
szResult[len] = '\0';
- mir_free(dbv.pszVal);
}
- else{
- res = 1;
- if (szError)
- {
- size_t tmp = mir_strlen(szError);
- len = (tmp < size - 1) ? tmp : size - 1;
- strncpy(szResult, szError, len);
- szResult[len] = '\0';
- }
- else{
- szResult[0] = '\0';
- }
+ else {
+ szResult[0] = '\0';
}
+ }
return res;
}
int GetStringFromDatabase(MCONTACT hContact, char *szModule, char *szSettingName, WCHAR *szError, WCHAR *szResult, size_t count)
{
- DBVARIANT dbv = {0};
+ DBVARIANT dbv = { 0 };
int res = 1;
size_t len;
dbv.type = DBVT_WCHAR;
- if (db_get_ws(hContact, szModule, szSettingName, &dbv) == 0)
- {
- res = 0;
- if (dbv.type != DBVT_WCHAR)
- {
- MultiByteToWideChar(CP_ACP, 0, dbv.pszVal, -1, szResult, (int) count);
- }
- else{
- size_t tmp = mir_wstrlen(dbv.pwszVal);
- len = (tmp < count - 1) ? tmp : count - 1;
- wcsncpy(szResult, dbv.pwszVal, len);
- szResult[len] = L'\0';
- }
- mir_free(dbv.pwszVal);
+ if (db_get_ws(hContact, szModule, szSettingName, &dbv) == 0) {
+ res = 0;
+ if (dbv.type != DBVT_WCHAR) {
+ MultiByteToWideChar(CP_ACP, 0, dbv.pszVal, -1, szResult, (int)count);
}
- else{
- res = 1;
- if (szError)
- {
- size_t tmp = mir_wstrlen(szError);
- len = (tmp < count - 1) ? tmp : count - 1;
- wcsncpy(szResult, szError, len);
- szResult[len] = L'\0';
- }
- else{
- szResult[0] = L'\0';
- }
+ else {
+ size_t tmp = mir_wstrlen(dbv.pwszVal);
+ len = (tmp < count - 1) ? tmp : count - 1;
+ wcsncpy(szResult, dbv.pwszVal, len);
+ szResult[len] = L'\0';
}
+ mir_free(dbv.pwszVal);
+ }
+ else {
+ res = 1;
+ if (szError) {
+ size_t tmp = mir_wstrlen(szError);
+ len = (tmp < count - 1) ? tmp : count - 1;
+ wcsncpy(szResult, szError, len);
+ szResult[len] = L'\0';
+ }
+ else {
+ szResult[0] = L'\0';
+ }
+ }
return res;
}
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 49ca5c36e3..c18dad2c35 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -126,15 +126,15 @@ struct CONNECTION* LoadSettingsConnections() struct CONNECTION *conn = (struct CONNECTION*)mir_alloc(sizeof(struct CONNECTION));
mir_snprintf(buff, "%dFilterIntIp", i);
if (!db_get_ws(NULL, PLUGINNAME, buff, &dbv))
- wcsncpy(conn->strIntIp, dbv.ptszVal, _countof(conn->strIntIp));
+ wcsncpy(conn->strIntIp, dbv.pwszVal, _countof(conn->strIntIp));
db_free(&dbv);
mir_snprintf(buff, "%dFilterExtIp", i);
if (!db_get_ws(NULL, PLUGINNAME, buff, &dbv))
- wcsncpy(conn->strExtIp, dbv.ptszVal, _countof(conn->strExtIp));
+ wcsncpy(conn->strExtIp, dbv.pwszVal, _countof(conn->strExtIp));
db_free(&dbv);
mir_snprintf(buff, "%dFilterPName", i);
if (!db_get_ws(NULL, PLUGINNAME, buff, &dbv))
- wcsncpy(conn->PName, dbv.ptszVal, _countof(conn->PName));
+ wcsncpy(conn->PName, dbv.pwszVal, _countof(conn->PName));
db_free(&dbv);
mir_snprintf(buff, "%dFilterIntPort", i);
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index 5910de994a..fd8adfb792 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -88,7 +88,7 @@ static int ModulesLoad(WPARAM, LPARAM) else {
DBVARIANT dbv;
if (!db_get_ws(0, MODULENAME, "Folder", &dbv)) {
- wcsncpy_s(options.folder, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(options.folder, dbv.pwszVal, _TRUNCATE);
db_free(&dbv);
}
else mir_snwprintf(options.folder, L"%s%s", DIR, SUB_DIR);
diff --git a/plugins/Exchange/src/utils.cpp b/plugins/Exchange/src/utils.cpp index 96153d13b1..75b4ef4b93 100644 --- a/plugins/Exchange/src/utils.cpp +++ b/plugins/Exchange/src/utils.cpp @@ -115,11 +115,11 @@ int GetStringFromDatabase(char *szSettingName, wchar_t *szError, wchar_t *szResu dbv.type = DBVT_ASCIIZ;
if (db_get_ws(NULL, MODULENAME, szSettingName, &dbv) == 0) {
res = 0;
- size_t tmp = mir_wstrlen(dbv.ptszVal);
+ size_t tmp = mir_wstrlen(dbv.pwszVal);
size_t len = (tmp < size - 1) ? tmp : size - 1;
- wcsncpy(szResult, dbv.ptszVal, len);
+ wcsncpy(szResult, dbv.pwszVal, len);
szResult[len] = '\0';
- mir_free(dbv.ptszVal);
+ mir_free(dbv.pwszVal);
}
else {
res = 1;
diff --git a/plugins/FloatingContacts/src/options.cpp b/plugins/FloatingContacts/src/options.cpp index 689ab51453..6f80b462eb 100644 --- a/plugins/FloatingContacts/src/options.cpp +++ b/plugins/FloatingContacts/src/options.cpp @@ -181,7 +181,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP {
DBVARIANT dbv;
if (!db_get_ws(NULL, MODULE, "BkBitmap", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_FILENAME, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_FILENAME, dbv.pwszVal);
db_free(&dbv);
}
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 44c430dd8b..726f5947da 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -97,16 +97,12 @@ string DBGetString(MCONTACT hContact, const char *szModule, const char *szSettin {
string ret;
DBVARIANT dbv = { 0 };
- if (!db_get(hContact, szModule, szSetting, &dbv)) {
- if (dbv.type != DBVT_ASCIIZ) {
- MessageBox(nullptr, "DB: Attempt to get wrong type of value, string", MSG_BOX_TITEL, MB_OK);
- ret = pszError;
- }
- else ret = dbv.pszVal;
+ if (!db_get_s(hContact, szModule, szSetting, &dbv)) {
+ ret = dbv.pszVal;
+ db_free(&dbv);
}
else ret = pszError;
- db_free(&dbv);
return ret;
}
@@ -1033,14 +1029,12 @@ static INT_PTR nShareNewFile(WPARAM hContact, LPARAM lParam) if (hContact) {
// Try to locate an IP address.
DBVARIANT dbv = { 0 };
- if (!db_get(hContact, "Protocol", "p", &dbv)) {
- if (dbv.type == DBVT_ASCIIZ) {
- stNewShare.dwAllowedIP = db_get_dw(hContact, dbv.pszVal, "IP", 0);
- if (!stNewShare.dwAllowedIP)
- stNewShare.dwAllowedIP = db_get_dw(hContact, dbv.pszVal, "RealIP", 0);
- if (!stNewShare.dwAllowedIP)
- stNewShare.dwAllowedIP = db_get_dw(hContact, MODULENAME, "LastUsedIP", 0);
- }
+ if (!db_get_s(hContact, "Protocol", "p", &dbv)) {
+ stNewShare.dwAllowedIP = db_get_dw(hContact, dbv.pszVal, "IP", 0);
+ if (!stNewShare.dwAllowedIP)
+ stNewShare.dwAllowedIP = db_get_dw(hContact, dbv.pszVal, "RealIP", 0);
+ if (!stNewShare.dwAllowedIP)
+ stNewShare.dwAllowedIP = db_get_dw(hContact, MODULENAME, "LastUsedIP", 0);
}
db_free(&dbv);
diff --git a/plugins/IEView/src/ChatHTMLBuilder.cpp b/plugins/IEView/src/ChatHTMLBuilder.cpp index b956a740c7..8c14599e6c 100644 --- a/plugins/IEView/src/ChatHTMLBuilder.cpp +++ b/plugins/IEView/src/ChatHTMLBuilder.cpp @@ -73,7 +73,7 @@ void ChatHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, "Font%d", i);
- if (db_get(NULL, CHATFONTMOD, str, &dbv))
+ if (db_get_s(NULL, CHATFONTMOD, str, &dbv))
strncpy_s(lf->lfFaceName, "Verdana", _TRUNCATE);
else {
strncpy_s(lf->lfFaceName, dbv.pszVal, _TRUNCATE);
diff --git a/plugins/IEView/src/HistoryHTMLBuilder.cpp b/plugins/IEView/src/HistoryHTMLBuilder.cpp index cf343e9651..8cb6fc1b9e 100644 --- a/plugins/IEView/src/HistoryHTMLBuilder.cpp +++ b/plugins/IEView/src/HistoryHTMLBuilder.cpp @@ -123,7 +123,7 @@ void HistoryHTMLBuilder::loadMsgDlgFont(const char *dbSetting, LOGFONTA * lf, CO lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, "Font.%s.Name", dbSetting);
- if (db_get(NULL, HPPMOD, str, &dbv))
+ if (db_get_s(NULL, HPPMOD, str, &dbv))
strncpy_s(lf->lfFaceName, "Verdana", _TRUNCATE);
else {
strncpy_s(lf->lfFaceName, dbv.pszVal, _TRUNCATE);
diff --git a/plugins/IEView/src/MUCCHTMLBuilder.cpp b/plugins/IEView/src/MUCCHTMLBuilder.cpp index bbcdd90c3e..b787a1017e 100644 --- a/plugins/IEView/src/MUCCHTMLBuilder.cpp +++ b/plugins/IEView/src/MUCCHTMLBuilder.cpp @@ -69,7 +69,7 @@ void MUCCHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, "Font%dFace", i);
- if (db_get(NULL, MUCCMOD, str, &dbv))
+ if (db_get_s(NULL, MUCCMOD, str, &dbv))
strncpy_s(lf->lfFaceName, "Verdana", _TRUNCATE);
else {
strncpy_s(lf->lfFaceName, dbv.pszVal, _TRUNCATE);
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index 3fb64021ee..2a21e47e5b 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -1504,7 +1504,7 @@ void Options::init() mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_FLAGS);
proto->setSRMMFlags(db_get_dw(NULL, ieviewModuleName, dbsName, 16128));
mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_BACKGROUND);
- if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get_s(NULL, ieviewModuleName, dbsName, &dbv)) {
strncpy_s(tmpPath, dbv.pszVal, _TRUNCATE);
if (strncmp(tmpPath, "http://", 7))
PathToAbsolute(dbv.pszVal, tmpPath);
@@ -1513,7 +1513,7 @@ void Options::init() db_free(&dbv);
}
mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_CSS);
- if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get_s(NULL, ieviewModuleName, dbsName, &dbv)) {
strncpy_s(tmpPath, dbv.pszVal, _TRUNCATE);
if (strncmp(tmpPath, "http://", 7))
PathToAbsolute(dbv.pszVal, tmpPath);
@@ -1522,7 +1522,7 @@ void Options::init() db_free(&dbv);
}
mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_TEMPLATE);
- if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get_s(NULL, ieviewModuleName, dbsName, &dbv)) {
strncpy_s(tmpPath, dbv.pszVal, _TRUNCATE);
PathToAbsolute(dbv.pszVal, tmpPath);
proto->setSRMMTemplateFilename(tmpPath);
@@ -1537,7 +1537,7 @@ void Options::init() mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_FLAGS);
proto->setChatFlags(db_get_dw(NULL, ieviewModuleName, dbsName, 16128));
mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_BACKGROUND);
- if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get_s(NULL, ieviewModuleName, dbsName, &dbv)) {
strncpy_s(tmpPath, dbv.pszVal, _TRUNCATE);
if (strncmp(tmpPath, "http://", 7))
PathToAbsolute(dbv.pszVal, tmpPath);
@@ -1546,7 +1546,7 @@ void Options::init() db_free(&dbv);
}
mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_CSS);
- if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get_s(NULL, ieviewModuleName, dbsName, &dbv)) {
strncpy_s(tmpPath, dbv.pszVal, _TRUNCATE);
if (strncmp(tmpPath, "http://", 7))
PathToAbsolute(dbv.pszVal, tmpPath);
@@ -1555,7 +1555,7 @@ void Options::init() db_free(&dbv);
}
mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_TEMPLATE);
- if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get_s(NULL, ieviewModuleName, dbsName, &dbv)) {
strncpy_s(tmpPath, dbv.pszVal, _TRUNCATE);
PathToAbsolute(dbv.pszVal, tmpPath);
proto->setChatTemplateFilename(tmpPath);
@@ -1570,7 +1570,7 @@ void Options::init() mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_FLAGS);
proto->setHistoryFlags(db_get_dw(NULL, ieviewModuleName, dbsName, 16128));
mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_BACKGROUND);
- if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get_s(NULL, ieviewModuleName, dbsName, &dbv)) {
strncpy_s(tmpPath, dbv.pszVal, _TRUNCATE);
if (strncmp(tmpPath, "http://", 7))
PathToAbsolute(dbv.pszVal, tmpPath);
@@ -1579,7 +1579,7 @@ void Options::init() db_free(&dbv);
}
mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_CSS);
- if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get_s(NULL, ieviewModuleName, dbsName, &dbv)) {
strncpy_s(tmpPath, dbv.pszVal, _TRUNCATE);
if (strncmp(tmpPath, "http://", 7))
PathToAbsolute(dbv.pszVal, tmpPath);
@@ -1588,7 +1588,7 @@ void Options::init() db_free(&dbv);
}
mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_TEMPLATE);
- if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get_s(NULL, ieviewModuleName, dbsName, &dbv)) {
strncpy_s(tmpPath, dbv.pszVal, _TRUNCATE);
PathToAbsolute(dbv.pszVal, tmpPath);
proto->setHistoryTemplateFilename(tmpPath);
diff --git a/plugins/IEView/src/ScriverHTMLBuilder.cpp b/plugins/IEView/src/ScriverHTMLBuilder.cpp index c0e569cca7..c910643352 100644 --- a/plugins/IEView/src/ScriverHTMLBuilder.cpp +++ b/plugins/IEView/src/ScriverHTMLBuilder.cpp @@ -111,7 +111,7 @@ void ScriverHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, "SRMFont%d", i);
- if (db_get(NULL, SRMMMOD, str, &dbv))
+ if (db_get_s(NULL, SRMMMOD, str, &dbv))
strncpy_s(lf->lfFaceName, "Verdana", _TRUNCATE);
else {
strncpy_s(lf->lfFaceName, dbv.pszVal, _TRUNCATE);
diff --git a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp index 01e63bdc89..fbd8771138 100644 --- a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp +++ b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp @@ -142,7 +142,7 @@ void TabSRMMHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
mir_snprintf(str, "Font%d", i);
- if (db_get(NULL, TABSRMM_FONTMODULE, str, &dbv))
+ if (db_get_s(NULL, TABSRMM_FONTMODULE, str, &dbv))
strncpy_s(lf->lfFaceName, "Verdana", _TRUNCATE);
else {
strncpy_s(lf->lfFaceName, dbv.pszVal, _TRUNCATE);
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index bdf5882c08..1440221bc8 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -49,13 +49,13 @@ char* TemplateHTMLBuilder::getAvatar(MCONTACT hContact, const char *szProto) result = ace->szFilename;
}
if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) {
- if (mir_wstrlen(dbv.ptszVal) > 0) {
- //wchar_t *ext = wcsrchr(dbv.ptszVal, '.');
+ if (mir_wstrlen(dbv.pwszVal) > 0) {
+ //wchar_t *ext = wcsrchr(dbv.pwszVal, '.');
if (result == nullptr) {
/* relative -> absolute */
- wcsncpy_s(tmpPath, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(tmpPath, dbv.pwszVal, _TRUNCATE);
if (wcsncmp(tmpPath, L"http://", 7))
- PathToAbsoluteW(dbv.ptszVal, tmpPath);
+ PathToAbsoluteW(dbv.pwszVal, tmpPath);
result = tmpPath;
}
}
@@ -168,7 +168,7 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr if (szAvatarOut == nullptr)
szAvatarOut = mir_strdup(szNoAvatar);
- if (!db_get(event->hContact, "CList", "StatusMsg", &dbv)) {
+ if (!db_get_s(event->hContact, "CList", "StatusMsg", &dbv)) {
if (mir_strlen(dbv.pszVal) > 0)
szStatusMsg = mir_utf8encode(dbv.pszVal);
db_free(&dbv);
@@ -341,7 +341,7 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, szAvatarOut = mir_strdup(szNoAvatar);
if (event->hContact != NULL) {
- if (!db_get(event->hContact, "CList", "StatusMsg", &dbv)) {
+ if (!db_get_s(event->hContact, "CList", "StatusMsg", &dbv)) {
if (mir_strlen(dbv.pszVal) > 0)
szStatusMsg = mir_utf8encode(dbv.pszVal);
db_free(&dbv);
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index 865e30cc7b..c5392401f7 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -121,7 +121,7 @@ static int myGetD(MCONTACT hContact, const char *szModule, const char *szSetting static wchar_t* myGetWs(MCONTACT hContact, const char *szModule, const char *szSetting)
{
DBVARIANT dbv = { DBVT_WCHAR };
- return srcDb->GetContactSettingStr(hContact, szModule, szSetting, &dbv) ? nullptr : dbv.ptszVal;
+ return srcDb->GetContactSettingStr(hContact, szModule, szSetting, &dbv) ? nullptr : dbv.pwszVal;
}
static BOOL myGetS(MCONTACT hContact, const char *szModule, const char *szSetting, char *dest)
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index d7ee6d32d6..1388406bca 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -183,7 +183,7 @@ int ModulesLoaded(WPARAM, LPARAM) if (proto != nullptr) {
DBVARIANT dbv;
if (!db_get_ws(hContact, proto, "ListeningTo", &dbv)) {
- if (dbv.ptszVal != nullptr && dbv.ptszVal[0] != 0)
+ if (dbv.pwszVal != nullptr && dbv.pwszVal[0] != 0)
SetExtraIcon(hContact, TRUE);
db_free(&dbv);
@@ -810,7 +810,7 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) if (proto == nullptr || strcmp(cws->szModule, proto) != 0)
return 0;
- if (cws->value.type == DBVT_DELETED || cws->value.ptszVal == nullptr || cws->value.ptszVal[0] == 0)
+ if (cws->value.type == DBVT_DELETED || cws->value.pwszVal == nullptr || cws->value.pwszVal[0] == 0)
SetExtraIcon(hContact, FALSE);
else
SetExtraIcon(hContact, TRUE);
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 6c70db5ab3..253580bc73 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -980,7 +980,7 @@ static void LoadSettings() strncpy_s(settingServerSec, _countof(settingServerSec), dbv.pszVal, _countof(settingServerSec));
db_free(&dbv);
}
- if (!db_get(NULL, MODULENAME, "LNPassword", &dbv)) {
+ if (!db_get_s(NULL, MODULENAME, "LNPassword", &dbv)) {
strncpy_s(settingPassword, _countof(settingPassword), dbv.pszVal, _countof(settingPassword));
db_free(&dbv);
}
@@ -994,15 +994,15 @@ static void LoadSettings() }
if (!db_get_ws(NULL, MODULENAME, "LNFilterSender", &dbv)) {
- wcsncpy_s(settingFilterSender, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(settingFilterSender, dbv.pwszVal, _TRUNCATE);
db_free(&dbv);
}
if (!db_get_ws(NULL, MODULENAME, "LNFilterSubject", &dbv)) {
- wcsncpy_s(settingFilterSubject, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(settingFilterSubject, dbv.pwszVal, _TRUNCATE);
db_free(&dbv);
}
if (!db_get_ws(NULL, MODULENAME, "LNFilterTo", &dbv)) {
- wcsncpy_s(settingFilterTo, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(settingFilterTo, dbv.pwszVal, _TRUNCATE);
db_free(&dbv);
}
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 2ab2c723ab..41cc3e307d 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -450,7 +450,7 @@ tstring CAppletManager::GetContactGroup(MCONTACT hContact) tstring strGroup = L""; if (!res) - strGroup = dbv.ptszVal; + strGroup = dbv.pwszVal; db_free(&dbv); return strGroup; @@ -1448,7 +1448,7 @@ int CAppletManager::HookStatusChanged(WPARAM wParam, LPARAM lParam) DBVARIANT dbv; if (db_get_ws(Event.hContact, szProto, "Nick", &dbv)) return 0; - CAppletManager::GetInstance()->CreateIRCHistory(Event.hContact, dbv.ptszVal); + CAppletManager::GetInstance()->CreateIRCHistory(Event.hContact, dbv.pwszVal); db_free(&dbv); } else @@ -1656,7 +1656,7 @@ int CAppletManager::HookSettingChanged(WPARAM hContact, LPARAM lParam) char *szProto = GetContactProto(Event.hContact); if (db_get_ws(Event.hContact, szProto, "Nick", &dbv)) return 0; - Event.strValue = dbv.ptszVal; + Event.strValue = dbv.pwszVal; db_free(&dbv); } } @@ -1670,7 +1670,7 @@ int CAppletManager::HookSettingChanged(WPARAM hContact, LPARAM lParam) DBVARIANT dbv; int res = db_get_ws(hContact, "CList", "Group", &dbv); if (!res) - Event.strValue = dbv.ptszVal; + Event.strValue = dbv.pwszVal; db_free(&dbv); } else return 0; diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp index e2302eac84..2efd773872 100644 --- a/plugins/MirandaG15/src/CConfig.cpp +++ b/plugins/MirandaG15/src/CConfig.cpp @@ -333,7 +333,7 @@ void CConfig::LoadFontSettings(int iFont) if (db_get_ws(NULL, "MirandaG15", szSetting, &dbv))
mir_wstrcpy(m_logfont[iFont].lfFaceName, L"Small Fonts");
else {
- mir_wstrcpy(m_logfont[iFont].lfFaceName, dbv.ptszVal);
+ mir_wstrcpy(m_logfont[iFont].lfFaceName, dbv.pwszVal);
db_free(&dbv);
}
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 1ab91a64c9..2dbfbdec7b 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -224,17 +224,12 @@ tstring _DBGetStringW(MCONTACT hContact, const char *szModule, const char *szSet {
tstring ret;
DBVARIANT dbv = { 0 };
- //db_get
if (!db_get_ws(hContact, szModule, szSetting, &dbv)) {
- if (dbv.type != DBVT_WCHAR) {
- MessageBox(nullptr, TranslateT("Database: Attempt to get wrong type of value, string"), MSG_BOX_TITEL, MB_OK);
- ret = pszError;
- }
- else ret = (wchar_t*)dbv.pszVal;
+ ret = (wchar_t*)dbv.pszVal;
+ db_free(&dbv);
}
else ret = pszError;
- db_free(&dbv);
return ret;
}
@@ -242,16 +237,12 @@ string _DBGetStringA(MCONTACT hContact, const char *szModule, const char *szSett {
string ret;
DBVARIANT dbv = { 0 };
- if (!db_get(hContact, szModule, szSetting, &dbv)) {
- if (dbv.type != DBVT_ASCIIZ) {
- MessageBox(nullptr, TranslateT("Database: Attempt to get wrong type of value, string"), MSG_BOX_TITEL, MB_OK);
- ret = pszError;
- }
- else ret = dbv.pszVal;
+ if (!db_get_s(hContact, szModule, szSetting, &dbv)) {
+ ret = dbv.pszVal;
+ db_free(&dbv);
}
else ret = pszError;
- db_free(&dbv);
return ret;
}
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index 00928f4c71..1e2d693278 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -330,7 +330,7 @@ wchar_t *Protocol::GetListeningTo() return listening_to;
}
- lcopystr(listening_to, dbv.ptszVal, _countof(listening_to));
+ lcopystr(listening_to, dbv.pwszVal, _countof(listening_to));
db_free(&dbv);
return listening_to;
}
diff --git a/plugins/NewAwaySysMod/src/CString.cpp b/plugins/NewAwaySysMod/src/CString.cpp index 60b9ac0985..cb9b2f4903 100644 --- a/plugins/NewAwaySysMod/src/CString.cpp +++ b/plugins/NewAwaySysMod/src/CString.cpp @@ -291,7 +291,7 @@ TCString DBGetContactSettingAsString(MCONTACT hContact, const char *szModule, co TCString Result;
if (!iRes && (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR))
{
- Result = dbv.ptszVal;
+ Result = dbv.pwszVal;
}
else if (dbv.type == DBVT_BYTE || dbv.type == DBVT_WORD || dbv.type == DBVT_DWORD)
{
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index db3911f2a2..8213441bc2 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -150,7 +150,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA lvi.iItem = ListView_InsertItem(hList, &lvi);
if (!db_get_ws(hContact, MODULE, StatusList[Index(i)].lpzSkinSoundName, &dbv)) {
- mir_wstrcpy(buff, dbv.ptszVal);
+ mir_wstrcpy(buff, dbv.pwszVal);
db_free(&dbv);
}
else mir_wstrcpy(buff, TranslateW(DEFAULT_SOUND));
@@ -170,7 +170,7 @@ INT_PTR CALLBACK DlgProcSoundUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA lvi.iItem = ListView_InsertItem(hList, &lvi);
if (!db_get_ws(hContact, MODULE, StatusList[i].lpzSkinSoundName, &dbv)) {
- wcsncpy(buff, dbv.ptszVal, _countof(buff)-1);
+ wcsncpy(buff, dbv.pwszVal, _countof(buff)-1);
db_free(&dbv);
}
else wcsncpy(buff, TranslateW(DEFAULT_SOUND), _countof(buff)-1);
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index 23d3587ab9..fb0ab7083d 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -339,7 +339,7 @@ void PlayChangeSound(MCONTACT hContact, const char *name) DBVARIANT dbv;
wchar_t stzSoundFile[MAX_PATH] = { 0 };
if (!db_get_ws(hContact, MODULE, name, &dbv)) {
- wcsncpy(stzSoundFile, dbv.ptszVal, _countof(stzSoundFile) - 1);
+ wcsncpy(stzSoundFile, dbv.pwszVal, _countof(stzSoundFile) - 1);
db_free(&dbv);
}
@@ -710,7 +710,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) str = GetStr(&smi, DEFAULT_POPUP_SMSGREMOVED);
}
else {
- str = GetStr(&smi, dbVar.ptszVal);
+ str = GetStr(&smi, dbVar.pwszVal);
db_free(&dbVar);
}
}
@@ -722,7 +722,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) str = GetStr(&smi, DEFAULT_POPUP_SMSGCHANGED);
}
else {
- str = GetStr(&smi, dbVar.ptszVal);
+ str = GetStr(&smi, dbVar.pwszVal);
db_free(&dbVar);
}
}
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index c109c5fafd..7d1758572b 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -705,7 +705,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (db_get_ws(NULL, MODULE, protoname, &dbVar))
wcsncpy(prototemplate->ProtoTemplateMsg, DEFAULT_POPUP_SMSGCHANGED, _countof(prototemplate->ProtoTemplateMsg));
else {
- wcsncpy(prototemplate->ProtoTemplateMsg, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateMsg));
+ wcsncpy(prototemplate->ProtoTemplateMsg, dbVar.pwszVal, _countof(prototemplate->ProtoTemplateMsg));
db_free(&dbVar);
}
@@ -713,7 +713,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (db_get_ws(NULL, MODULE, protoname, &dbVar))
wcsncpy(prototemplate->ProtoTemplateRemoved, DEFAULT_POPUP_SMSGREMOVED, _countof(prototemplate->ProtoTemplateRemoved));
else {
- wcsncpy(prototemplate->ProtoTemplateRemoved, dbVar.ptszVal, _countof(prototemplate->ProtoTemplateRemoved));
+ wcsncpy(prototemplate->ProtoTemplateRemoved, dbVar.pwszVal, _countof(prototemplate->ProtoTemplateRemoved));
db_free(&dbVar);
}
diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp index 120964b038..07c1539e2e 100644 --- a/plugins/NewXstatusNotify/src/utils.cpp +++ b/plugins/NewXstatusNotify/src/utils.cpp @@ -38,7 +38,7 @@ int DBGetStringDefault(MCONTACT hContact, const char *szModule, const char *szSe {
DBVARIANT dbv;
if (!db_get_ws(hContact, szModule, szSetting, &dbv)) {
- wcsncpy(setting, dbv.ptszVal, size);
+ wcsncpy(setting, dbv.pwszVal, size);
db_free(&dbv);
return 0;
}
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 697876bf22..906a4696de 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -429,10 +429,10 @@ wchar_t* GetIcqXStatus(MCONTACT hContact, char *szProto, char *szValue, wchar_t int statusID = db_get_b(hContact, szProto, "XStatusId", -1);
if (statusID != -1) {
if (!db_get_ws(hContact, szProto, szValue, &dbv)) {
- if ((mir_strcmp(szValue, "XStatusName") == 0) && dbv.ptszVal[0] == 0)
+ if ((mir_strcmp(szValue, "XStatusName") == 0) && dbv.pwszVal[0] == 0)
GetDefaultXstatusName(statusID, szProto, buff, bufflen);
else
- wcsncpy(buff, dbv.ptszVal, bufflen);
+ wcsncpy(buff, dbv.pwszVal, bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
@@ -450,7 +450,7 @@ wchar_t* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue);
if (!db_get_ws(hContact, "AdvStatus", szSetting, &dbv)) {
- wcsncpy(buff, dbv.ptszVal, bufflen);
+ wcsncpy(buff, dbv.pwszVal, bufflen);
buff[bufflen - 1] = 0;
db_free(&dbv);
}
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index b4da20d147..fc042ff105 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -27,7 +27,7 @@ wchar_t* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModu if (db_get_ws(hContact, szModule, szSetting, &dbv)) return mir_wstrdup(szDef); else if (dbv.pszVal) - szRes = mir_wstrdup(dbv.ptszVal); + szRes = mir_wstrdup(dbv.pwszVal); else szRes = mir_wstrdup(szDef); diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp index a9b27e33eb..ec3a49d1e3 100644 --- a/plugins/Non-IM Contact/src/contactinfo.cpp +++ b/plugins/Non-IM Contact/src/contactinfo.cpp @@ -121,12 +121,12 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP /* link*/
DBVARIANT dbv;
if (!db_get_ws(hContact, MODNAME, "ProgramString", &dbv)) {
- SetDlgItemText(hwnd, IDC_LINK, dbv.ptszVal);
+ SetDlgItemText(hwnd, IDC_LINK, dbv.pwszVal);
db_free(&dbv);
}
if (!db_get_ws(hContact, MODNAME, "ProgramParamsString", &dbv)) {
- SetDlgItemText(hwnd, IDC_PARAMS, dbv.ptszVal);
+ SetDlgItemText(hwnd, IDC_PARAMS, dbv.pwszVal);
db_free(&dbv);
}
@@ -136,7 +136,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP SendDlgItemMessage(hwnd, IDC_GROUP, CB_INSERTSTRING, 0, LPARAM(szGroup));
if (!db_get_ws(hContact, "CList", "Group", &dbv)) {
- SetDlgItemText(hwnd, IDC_GROUP, dbv.ptszVal);
+ SetDlgItemText(hwnd, IDC_GROUP, dbv.pwszVal);
db_free(&dbv);
}
diff --git a/plugins/NotifyAnything/src/options.cpp b/plugins/NotifyAnything/src/options.cpp index cbebfd6b59..0976c9151e 100644 --- a/plugins/NotifyAnything/src/options.cpp +++ b/plugins/NotifyAnything/src/options.cpp @@ -157,12 +157,12 @@ void load_settings() DBVARIANT dbv;
if (!db_get_ws(NULL, MODULENAME, "password", &dbv)) {
- g_settings.password = dbv.ptszVal;
+ g_settings.password = dbv.pwszVal;
db_free(&dbv);
}
if (!db_get_ws(NULL, MODULENAME, "log_filename", &dbv)) {
- g_settings.log_filename = dbv.ptszVal;
+ g_settings.log_filename = dbv.pwszVal;
db_free(&dbv);
}
else
diff --git a/plugins/Nudge/src/nudge.cpp b/plugins/Nudge/src/nudge.cpp index 9dc4476a54..0fd8bf670f 100644 --- a/plugins/Nudge/src/nudge.cpp +++ b/plugins/Nudge/src/nudge.cpp @@ -82,7 +82,7 @@ void CNudgeElement::Load(void) mir_snprintf(SectionName, "%s-recText", ProtocolName);
if (!db_get_ws(NULL, MODULENAME, SectionName, &dbv)) {
- wcsncpy(this->recText, dbv.ptszVal, TEXT_LEN);
+ wcsncpy(this->recText, dbv.pwszVal, TEXT_LEN);
if (wcslen(this->recText) < 1)
wcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
db_free(&dbv);
@@ -91,7 +91,7 @@ void CNudgeElement::Load(void) mir_snprintf(SectionName, "%s-senText", ProtocolName);
if (!db_get_ws(NULL, MODULENAME, SectionName, &dbv)) {
- wcsncpy(this->senText, dbv.ptszVal, TEXT_LEN);
+ wcsncpy(this->senText, dbv.pwszVal, TEXT_LEN);
if (wcslen(this->senText) < 1)
wcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
db_free(&dbv);
diff --git a/plugins/Ping/src/log.cpp b/plugins/Ping/src/log.cpp index 6c183f40bf..2ac0f8db41 100644 --- a/plugins/Ping/src/log.cpp +++ b/plugins/Ping/src/log.cpp @@ -37,7 +37,7 @@ INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) { mir_wstrncat(filename, L"\\ping_log.txt", wParam - mir_wstrlen(filename));
}
else {
- mir_wstrncpy(filename, dbv.ptszVal, wParam);
+ mir_wstrncpy(filename, dbv.pwszVal, wParam);
db_free(&dbv);
}
diff --git a/plugins/Ping/src/pinglist.cpp b/plugins/Ping/src/pinglist.cpp index d0edc89823..33c7f34388 100644 --- a/plugins/Ping/src/pinglist.cpp +++ b/plugins/Ping/src/pinglist.cpp @@ -116,13 +116,13 @@ bool read_ping_address(PINGADDRESS &pa) { DBVARIANT dbv;
if (!db_get_ws(0, buff, "Address", &dbv)) {
- mir_wstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName));
+ mir_wstrncpy(pa.pszName, dbv.pwszVal, _countof(pa.pszName));
db_free(&dbv);
}
else return false;
if (!db_get_ws(0, buff, "Label", &dbv)) {
- mir_wstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel));
+ mir_wstrncpy(pa.pszLabel, dbv.pwszVal, _countof(pa.pszLabel));
db_free(&dbv);
}
else return false;
@@ -139,13 +139,13 @@ bool read_ping_address(PINGADDRESS &pa) { else pa.pszProto[0] = '\0';
if (!db_get_ws(0, buff, "Command", &dbv)) {
- mir_wstrncpy(pa.pszCommand, dbv.ptszVal, _countof(pa.pszCommand));
+ mir_wstrncpy(pa.pszCommand, dbv.pwszVal, _countof(pa.pszCommand));
db_free(&dbv);
}
else
pa.pszCommand[0] = '\0';
if (!db_get_ws(0, buff, "CommandParams", &dbv)) {
- mir_wstrncpy(pa.pszParams, dbv.ptszVal, _countof(pa.pszParams));
+ mir_wstrncpy(pa.pszParams, dbv.pwszVal, _countof(pa.pszParams));
db_free(&dbv);
}
else
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index dda9d77211..2f603ec3a0 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -222,7 +222,7 @@ void import_ping_address(int index, PINGADDRESS &pa) { char buf[256];
mir_snprintf(buf, "Address%d", index);
if (!db_get_ws(0, "PingPlug", buf, &dbv)) {
- mir_wstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName));
+ mir_wstrncpy(pa.pszName, dbv.pwszVal, _countof(pa.pszName));
db_free(&dbv);
}
else
@@ -230,7 +230,7 @@ void import_ping_address(int index, PINGADDRESS &pa) { mir_snprintf(buf, "Label%d", index);
if (!db_get_ws(0, "PingPlug", buf, &dbv)) {
- mir_wstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel));
+ mir_wstrncpy(pa.pszLabel, dbv.pwszVal, _countof(pa.pszLabel));
db_free(&dbv);
}
else
diff --git a/plugins/Popup/src/common.h b/plugins/Popup/src/common.h index 64269700b9..b078a6a1f8 100644 --- a/plugins/Popup/src/common.h +++ b/plugins/Popup/src/common.h @@ -70,7 +70,7 @@ inline INT_PTR DBGetContactSettingStringX(MCONTACT hContact, const char *ModuleN break;
case DBVT_WCHAR:
if (!result)
- ret = (INT_PTR)mir_wstrdup(dbv.ptszVal);
+ ret = (INT_PTR)mir_wstrdup(dbv.pwszVal);
else
ret = (INT_PTR)mir_a2u(Default);
break;
diff --git a/plugins/QuickContacts/src/dialog.cpp b/plugins/QuickContacts/src/dialog.cpp index 2b2e112b07..0d6aecf812 100644 --- a/plugins/QuickContacts/src/dialog.cpp +++ b/plugins/QuickContacts/src/dialog.cpp @@ -192,8 +192,8 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) if (opts.group_append) { DBVARIANT dbv; if (db_get_ws(hMeta == NULL ? hContact : hMeta, "CList", "Group", &dbv) == 0) { - if (dbv.ptszVal != nullptr) - mir_wstrncpy(contact->szgroup, dbv.ptszVal, _countof(contact->szgroup)); + if (dbv.pwszVal != nullptr) + mir_wstrncpy(contact->szgroup, dbv.pwszVal, _countof(contact->szgroup)); db_free(&dbv); } diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index bf6bb2ff66..82155af3c9 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -353,8 +353,8 @@ wchar_t* getMenuEntry(int buttonnum, int entrynum, BYTE mode) } if (!db_get_ws(NULL, MODULENAME, szMEntry, &dbv)) { - if (mir_wstrlen(dbv.ptszVal)) - buffer = mir_wstrdup(dbv.ptszVal); + if (mir_wstrlen(dbv.pwszVal)) + buffer = mir_wstrdup(dbv.pwszVal); db_free(&dbv); } diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index 2951ff1ce0..7ebf619817 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -51,14 +51,11 @@ void LoadDBSettings() LastUCOpt.HideOffline = db_get_b(NULL, MODULENAME, dbLastUC_HideOfflineContacts, 0);
LastUCOpt.WindowAutoSize = db_get_b(NULL, MODULENAME, dbLastUC_WindowAutosize, 0);
- DBVARIANT dbv;
- dbv.type = DBVT_ASCIIZ;
- dbv.pszVal = nullptr;
- if (db_get(NULL, MODULENAME, dbLastUC_DateTimeFormat, &dbv) == 0 && dbv.pszVal[0] != 0) {
- LastUCOpt.DateTimeFormat = dbv.pszVal;
- db_free(&dbv);
- }
- else LastUCOpt.DateTimeFormat = "(%Y-%m-%d %H:%M) ";
+ ptrA szFormat(db_get_sa(NULL, MODULENAME, dbLastUC_DateTimeFormat));
+ if (szFormat)
+ LastUCOpt.DateTimeFormat = szFormat;
+ else
+ LastUCOpt.DateTimeFormat = "(%Y-%m-%d %H:%M) ";
}
void ShowListMainDlgProc_AdjustListPos(HWND hDlg, LASTUC_DLG_DATA *DlgDat)
@@ -208,15 +205,9 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM std::wstring str;
char strtim[256 + 16];
- string strtimformat;
- DBVARIANT dbv;
- dbv.type = DBVT_ASCIIZ;
- dbv.pszVal = nullptr;
- if (db_get(NULL, MODULENAME, dbLastUC_DateTimeFormat, &dbv) == 0) {
- strtimformat = dbv.pszVal;
- db_free(&dbv);
- }
- else strtimformat = dbLastUC_DateTimeFormatDefault;
+ ptrA szFormat(db_get_sa(NULL, MODULENAME, dbLastUC_DateTimeFormat));
+ if (!szFormat)
+ szFormat = mir_strdup(dbLastUC_DateTimeFormatDefault);
for (auto curContact = DlgDat->Contacts->begin(); curContact != DlgDat->Contacts->end(); curContact++) {
if (curContact->second != NULL && db_get_b(curContact->second, MODULENAME, dbLastUC_IgnoreContact, 0) == 0) {
@@ -234,7 +225,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lvi.iSubItem = 0;
lvi.lParam = (LPARAM)curContact->second;
- strftime(strtim, 256, strtimformat.c_str(), _localtime64(&curContact->first));
+ strftime(strtim, 256, szFormat, _localtime64(&curContact->first));
strtim[255] = 0;
str = _A2T(strtim);
str += cname;
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index 1b26639ae9..ef904f371d 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -444,11 +444,11 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) }
if (lf) {
- if (db_get(NULL, SRMMMOD, str, &dbv)) {
+ if (db_get_ws(NULL, SRMMMOD, str, &dbv)) {
mir_wstrncpy(lf->lfFaceName, fontOptionsList[0].szDefFace, _countof(lf->lfFaceName));
}
else {
- mir_wstrncpy(lf->lfFaceName, dbv.ptszVal, _countof(lf->lfFaceName));
+ mir_wstrncpy(lf->lfFaceName, dbv.pwszVal, _countof(lf->lfFaceName));
db_free(&dbv);
}
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp index 4b5dbe0cb7..8ce68079e1 100644 --- a/plugins/SMS/src/senddlg.cpp +++ b/plugins/SMS/src/senddlg.cpp @@ -403,7 +403,8 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA mir_wstrcat(tszPhone, L" SMS");
for (DWORD i = 0; bCont; i++) {
mir_snprintf(szBuff, "MyPhone%d", i);
- if (db_get(psswdWindowData->hMyContact, "UserInfo", szBuff, &dbv)) bCont = FALSE;
+ if (db_get(psswdWindowData->hMyContact, "UserInfo", szBuff, &dbv))
+ bCont = FALSE;
db_free(&dbv);
}
DB_SetStringW(psswdWindowData->hMyContact, "UserInfo", szBuff, tszPhone);
diff --git a/plugins/Scriver/src/chat_options.cpp b/plugins/Scriver/src/chat_options.cpp index 4d2efeb4db..d128a7d832 100644 --- a/plugins/Scriver/src/chat_options.cpp +++ b/plugins/Scriver/src/chat_options.cpp @@ -225,7 +225,7 @@ static void InitSetting(wchar_t **ppPointer, char *pszSetting, wchar_t *pszDefau {
DBVARIANT dbv;
if (!db_get_ws(0, CHAT_MODULE, pszSetting, &dbv)) {
- replaceStrW(*ppPointer, dbv.ptszVal);
+ replaceStrW(*ppPointer, dbv.pwszVal);
db_free(&dbv);
}
else replaceStrW(*ppPointer, pszDefault);
diff --git a/plugins/SecureIM/src/popupOptions.cpp b/plugins/SecureIM/src/popupOptions.cpp index 6082ed09cc..f9288bdfac 100644 --- a/plugins/SecureIM/src/popupOptions.cpp +++ b/plugins/SecureIM/src/popupOptions.cpp @@ -20,19 +20,19 @@ INT_PTR CALLBACK PopOptionsDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l char *timeout;
//set timeout value for Key
- if (db_get(0, MODULENAME, "timeoutKey", &dbv) == 0) timeout = dbv.pszVal;
+ if (db_get_s(0, MODULENAME, "timeoutKey", &dbv) == 0) timeout = dbv.pszVal;
else timeout = "0";
SetDlgItemText(hDlg, IDC_TIMEKEY, timeout);
db_free(&dbv);
//set timeout value for SEC
- if (db_get(0, MODULENAME, "timeoutSec", &dbv) == 0) timeout = dbv.pszVal;
+ if (db_get_s(0, MODULENAME, "timeoutSec", &dbv) == 0) timeout = dbv.pszVal;
else timeout = "0";
SetDlgItemText(hDlg, IDC_TIMESEC, timeout);
db_free(&dbv);
//set timeout value for SR
- if (db_get(0, MODULENAME, "timeoutSR", &dbv) == 0) timeout = dbv.pszVal;
+ if (db_get_s(0, MODULENAME, "timeoutSR", &dbv) == 0) timeout = dbv.pszVal;
else timeout = "0";
SetDlgItemText(hDlg, IDC_TIMESR, timeout);
db_free(&dbv);
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index 75b5002c6d..750f8ee3a8 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -53,7 +53,7 @@ void HistoryWrite(MCONTACT hContact) wchar_t *ptszString;
DBVARIANT dbv;
if (!db_get_ws(NULL, S_MOD, "HistoryStamp", &dbv)) {
- ptszString = ParseString(dbv.ptszVal, hContact);
+ ptszString = ParseString(dbv.pwszVal, hContact);
db_free(&dbv);
}
else ptszString = ParseString(DEFAULT_HISTORYSTAMP, hContact);
@@ -89,7 +89,7 @@ void LoadHistoryList(MCONTACT hContact, HWND hwnd, int nList) DBVARIANT dbv;
if (!db_get_ws(hContact, S_MOD, BuildSetting(i), &dbv)) {
- SendDlgItemMessage(hwnd, nList, LB_ADDSTRING, 0, (LPARAM)dbv.ptszVal);
+ SendDlgItemMessage(hwnd, nList, LB_ADDSTRING, 0, (LPARAM)dbv.pwszVal);
db_free(&dbv);
}
else SendDlgItemMessage(hwnd, nList, LB_ADDSTRING, 0, (LPARAM)L"");
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index 8c9d456781..4dc20f51ec 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -116,13 +116,13 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp }
if (!db_get_ws(NULL, S_MOD, "PopupStamp", &dbv)) {
- SetDlgItemText(hdlg, IDC_POPUPSTAMP, dbv.ptszVal);
+ SetDlgItemText(hdlg, IDC_POPUPSTAMP, dbv.pwszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_POPUPSTAMP, DEFAULT_POPUPSTAMP);
if (!db_get_ws(NULL, S_MOD, "PopupStampText", &dbv)) {
- SetDlgItemText(hdlg, IDC_POPUPSTAMPTEXT, dbv.ptszVal);
+ SetDlgItemText(hdlg, IDC_POPUPSTAMPTEXT, dbv.pwszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_POPUPSTAMPTEXT, DEFAULT_POPUPSTAMPTEXT);
@@ -247,31 +247,31 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM EnableWindow(GetDlgItem(hdlg, IDC_COUNT), IsDlgButtonChecked(hdlg, IDC_MISSEDONES));
if (!db_get_ws(NULL, S_MOD, "MenuStamp", &dbv)) {
- SetDlgItemText(hdlg, IDC_MENUSTAMP, dbv.ptszVal);
+ SetDlgItemText(hdlg, IDC_MENUSTAMP, dbv.pwszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_MENUSTAMP, DEFAULT_MENUSTAMP);
if (!db_get_ws(NULL, S_MOD, "UserStamp", &dbv)) {
- SetDlgItemText(hdlg, IDC_USERSTAMP, dbv.ptszVal);
+ SetDlgItemText(hdlg, IDC_USERSTAMP, dbv.pwszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_USERSTAMP, DEFAULT_USERSTAMP);
if (!db_get_ws(NULL, S_MOD, "FileStamp", &dbv)) {
- SetDlgItemText(hdlg, IDC_FILESTAMP, dbv.ptszVal);
+ SetDlgItemText(hdlg, IDC_FILESTAMP, dbv.pwszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_FILESTAMP, DEFAULT_FILESTAMP);
if (!db_get_ws(NULL, S_MOD, "FileName", &dbv)) {
- SetDlgItemText(hdlg, IDC_FILENAME, dbv.ptszVal);
+ SetDlgItemText(hdlg, IDC_FILENAME, dbv.pwszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_FILENAME, DEFAULT_FILENAME);
if (!db_get_ws(NULL, S_MOD, "HistoryStamp", &dbv)) {
- SetDlgItemText(hdlg, IDC_HISTORYSTAMP, dbv.ptszVal);
+ SetDlgItemText(hdlg, IDC_HISTORYSTAMP, dbv.pwszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_HISTORYSTAMP, DEFAULT_HISTORYSTAMP);
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index efce4f5e25..4a74383b56 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -273,7 +273,7 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact) case 'G':
if (!db_get_ws(hcontact, "CList", "Group", &dbv)) {
- wcsncpy(szdbsetting, dbv.ptszVal, _countof(szdbsetting));
+ wcsncpy(szdbsetting, dbv.pwszVal, _countof(szdbsetting));
db_free(&dbv);
charPtr = szdbsetting;
goto LBL_charPtr;
@@ -303,7 +303,7 @@ wchar_t* ParseString(wchar_t *szstring, MCONTACT hcontact) if (db_get_ws(hcontact, "CList", "StatusMsg", &dbv))
goto LBL_noData;
- d += mir_snwprintf(d, MAXSIZE - (d - sztemp), L"%s", dbv.ptszVal);
+ d += mir_snwprintf(d, MAXSIZE - (d - sztemp), L"%s", dbv.pwszVal);
db_free(&dbv);
break;
@@ -486,13 +486,13 @@ void ShowPopup(MCONTACT hcontact, const char * lpzProto, int newStatus) ppd.lchIcon = Skin_LoadProtoIcon(lpzProto, newStatus);
if (!db_get_ws(NULL, S_MOD, "PopupStamp", &dbv)) {
- wcsncpy(ppd.lptzContactName, ParseString(dbv.ptszVal, hcontact), MAX_CONTACTNAME);
+ wcsncpy(ppd.lptzContactName, ParseString(dbv.pwszVal, hcontact), MAX_CONTACTNAME);
db_free(&dbv);
}
else wcsncpy(ppd.lptzContactName, ParseString(DEFAULT_POPUPSTAMP, hcontact), MAX_CONTACTNAME);
if (!db_get_ws(NULL, S_MOD, "PopupStampText", &dbv)) {
- wcsncpy(ppd.lptzText, ParseString(dbv.ptszVal, hcontact), MAX_SECONDLINE);
+ wcsncpy(ppd.lptzText, ParseString(dbv.pwszVal, hcontact), MAX_SECONDLINE);
db_free(&dbv);
}
else wcsncpy(ppd.lptzText, ParseString(DEFAULT_POPUPSTAMPTEXT, hcontact), MAX_SECONDLINE);
diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp index 4fb0a78f34..42fefe82aa 100644 --- a/plugins/SimpleAR/src/Options.cpp +++ b/plugins/SimpleAR/src/Options.cpp @@ -16,7 +16,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara DBVARIANT dbv;
if (!db_get_ws(NULL, MODULENAME, KEY_HEADING, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_HEADING, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_HEADING, dbv.pwszVal);
db_free(&dbv);
}
@@ -30,9 +30,9 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara if (!db_get_ws(NULL, MODULENAME, tszStatus, &dbv)) {
if (c < ID_STATUS_FREECHAT)
- ptszMessage[c - ID_STATUS_ONLINE - 1] = wcsdup(dbv.ptszVal);
+ ptszMessage[c - ID_STATUS_ONLINE - 1] = wcsdup(dbv.pwszVal);
else if (c > ID_STATUS_INVISIBLE)
- ptszMessage[c - ID_STATUS_ONLINE - 3] = wcsdup(dbv.ptszVal);
+ ptszMessage[c - ID_STATUS_ONLINE - 3] = wcsdup(dbv.pwszVal);
db_free(&dbv);
}
}
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index e2c18a576f..8933288e97 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -278,7 +278,7 @@ void OptionsDialogType::UpdateVisibleSmPackList(void) CMStringW ProtoName = it->GetName();
DBVARIANT dbv;
if (db_get_ws(NULL, _T2A(ProtoName.GetBuffer()), "AM_BaseProto", &dbv) == 0) {
- ProtoName = dbv.ptszVal;
+ ProtoName = dbv.pwszVal;
db_free(&dbv);
}
else
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index 21ca56813b..441b491af7 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -47,12 +47,12 @@ SmileyPackType* GetSmileyPack(const char *proto, MCONTACT hContact, SmileyPackCT if (protonam != nullptr) {
DBVARIANT dbv;
if (db_get_ws(hContact, protonam, "Transport", &dbv) == 0) {
- categoryName = dbv.ptszVal;
+ categoryName = dbv.pwszVal;
db_free(&dbv);
}
else if (opt.UsePhysProto && db_get_ws(NULL, protonam, "AM_BaseProto", &dbv) == 0) {
categoryName = L"AllProto";
- categoryName += dbv.ptszVal;
+ categoryName += dbv.pwszVal;
db_free(&dbv);
CMStringW categoryFileName = g_SmileyCategories.GetSmileyCategory(categoryName) ? g_SmileyCategories.GetSmileyCategory(categoryName)->GetFilename() : L"";
if (categoryFileName.IsEmpty())
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 8cb83f881d..1034a37b51 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -794,7 +794,7 @@ void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMStr if (db_get_ws(NULL, acc->szModuleName, "AM_BaseProto", &dbv) == 0) { PhysProtoName = L"AllProto"; - PhysProtoName += dbv.ptszVal; + PhysProtoName += dbv.pwszVal; db_free(&dbv); } @@ -861,7 +861,7 @@ void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc) DBVARIANT dbv; if (!db_get_ws(hContact, proto, "Transport", &dbv)) { - bool found = (tname.CompareNoCase(dbv.ptszVal) == 0); + bool found = (tname.CompareNoCase(dbv.pwszVal) == 0); db_free(&dbv); if (found) return; @@ -884,11 +884,11 @@ void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, co DBVARIANT dbv; if (!db_get_ws(hContact, proto, "Transport", &dbv)) { - if (dbv.ptszVal[0] == '\0') { + if (dbv.pwszVal[0] == '\0') { db_free(&dbv); return; } - char *trsp = mir_strdup(_T2A(dbv.ptszVal)); + char *trsp = mir_strdup(_T2A(dbv.pwszVal)); _strlwr(trsp); const char *packname = nullptr; @@ -905,7 +905,7 @@ void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, co mir_free(trsp); - CMStringW displayName = dbv.ptszVal; + CMStringW displayName = dbv.pwszVal; if (packname != nullptr) { char path[MAX_PATH]; mir_snprintf(path, "Smileys\\nova\\%s.msl", packname); diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index bb2a2d15db..8f2761300f 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -9,7 +9,7 @@ wchar_t* _getCOptS(wchar_t *buf, unsigned int buflen, MCONTACT hContact, const c if (db_get_ws(hContact, MODULENAME, option, &dbv) != 0)
wcsncpy(buf, def, min(buflen, mir_wstrlen(def)+1));
else if (dbv.type == DBVT_WCHAR) {
- wcsncpy(buf, dbv.ptszVal, min(buflen, mir_wstrlen(dbv.ptszVal)+1));
+ wcsncpy(buf, dbv.pwszVal, min(buflen, mir_wstrlen(dbv.pwszVal)+1));
}
db_free(&dbv);
return buf;
@@ -22,7 +22,7 @@ wchar_t* _getMOptS(wchar_t *buf, unsigned int buflen, const char* module, const if (db_get_s(NULL, module, option, &dbv) != 0)
wcsncpy(buf, def, min(buflen, mir_wstrlen(def)+1));
else if (dbv.type == DBVT_WCHAR) {
- wcsncpy(buf, dbv.ptszVal, min(buflen, mir_wstrlen(dbv.ptszVal)+1));
+ wcsncpy(buf, dbv.pwszVal, min(buflen, mir_wstrlen(dbv.pwszVal)+1));
} else {
tmp = mir_a2u(dbv.pszVal);
wcsncpy(buf, tmp, min(buflen, mir_wstrlen(tmp)+1));
diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp index 3127000d69..4b7c517c93 100644 --- a/plugins/SpellChecker/src/dictionary.cpp +++ b/plugins/SpellChecker/src/dictionary.cpp @@ -778,7 +778,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts) char lang[128]; WideCharToMultiByte(CP_ACP, 0, dict->language, -1, lang, sizeof(lang), nullptr, nullptr); if (!db_get_ws(NULL, MODULENAME, lang, &dbv)) { - mir_wstrncpy(dict->localized_name, dbv.ptszVal, _countof(dict->localized_name)); + mir_wstrncpy(dict->localized_name, dbv.pwszVal, _countof(dict->localized_name)); db_free(&dbv); } diff --git a/plugins/SpellChecker/src/options.cpp b/plugins/SpellChecker/src/options.cpp index 7302be7246..7fafa944e8 100644 --- a/plugins/SpellChecker/src/options.cpp +++ b/plugins/SpellChecker/src/options.cpp @@ -92,7 +92,7 @@ void LoadOptions() DBVARIANT dbv;
if (!db_get_ws(NULL, MODULENAME, "DefaultLanguage", &dbv)) {
- mir_wstrncpy(opts.default_language, dbv.ptszVal, _countof(opts.default_language));
+ mir_wstrncpy(opts.default_language, dbv.pwszVal, _countof(opts.default_language));
db_free(&dbv);
}
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index 1902d21b20..217e95daad 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -724,8 +724,8 @@ void GetUserProtoLanguageSetting(Dialog *dlg, MCONTACT hContact, char *group, ch return;
}
- if (dbv.type == DBVT_WCHAR && dbv.ptszVal != nullptr) {
- wchar_t *lang = dbv.ptszVal;
+ if (dbv.type == DBVT_WCHAR && dbv.pwszVal != nullptr) {
+ wchar_t *lang = dbv.pwszVal;
for (auto &dict : languages) {
if (mir_wstrcmpi(dict->localized_name, lang) == 0 || mir_wstrcmpi(dict->english_name, lang) == 0 || mir_wstrcmpi(dict->language, lang) == 0) {
@@ -770,18 +770,18 @@ void GetContactLanguage(Dialog *dlg) if (dlg->hContact == NULL) {
if (!db_get_ws(NULL, MODULENAME, dlg->name, &dbv)) {
- mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.pwszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
}
else {
if (!db_get_ws(dlg->hContact, MODULENAME, "TalkLanguage", &dbv)) {
- mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.pwszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
if (dlg->lang_name[0] == '\0' && !db_get_ws(dlg->hContact, "eSpeak", "TalkLanguage", &dbv)) {
- mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.pwszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
@@ -790,12 +790,12 @@ void GetContactLanguage(Dialog *dlg) MCONTACT hMetaContact = db_mc_getMeta(dlg->hContact);
if (hMetaContact != NULL) {
if (!db_get_ws(hMetaContact, MODULENAME, "TalkLanguage", &dbv)) {
- mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.pwszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
if (dlg->lang_name[0] == '\0' && !db_get_ws(hMetaContact, "eSpeak", "TalkLanguage", &dbv)) {
- mir_wstrncpy(dlg->lang_name, dbv.ptszVal, _countof(dlg->lang_name));
+ mir_wstrncpy(dlg->lang_name, dbv.pwszVal, _countof(dlg->lang_name));
db_free(&dbv);
}
}
diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index 47f949afc2..89c9c2ec2d 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -78,14 +78,14 @@ void SplashMain() if (bstartup & (options.active == 1)) {
DBVARIANT dbv = { 0 };
if (!db_get_ws(NULL, MODULENAME, "VersionPrefix", &dbv)) {
- mir_wstrcpy(szPrefix, dbv.ptszVal);
+ mir_wstrcpy(szPrefix, dbv.pwszVal);
db_free(&dbv);
}
else
mir_wstrcpy(szPrefix, L"");
if (!db_get_ws(NULL, MODULENAME, "Path", &dbv)) {
- mir_wstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.pwszVal);
db_free(&dbv);
}
else mir_wstrcpy(inBuf, L"splash\\splash.png");
@@ -102,7 +102,7 @@ void SplashMain() mir_wstrcpy(szSplashFile, inBuf);
if (!db_get_ws(NULL, MODULENAME, "Sound", &dbv)) {
- mir_wstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.pwszVal);
db_free(&dbv);
}
else mir_wstrcpy(inBuf, L"sounds\\startup.wav");
diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp index ae68e43f83..37758b59e5 100644 --- a/plugins/SplashScreen/src/options.cpp +++ b/plugins/SplashScreen/src/options.cpp @@ -54,21 +54,21 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP {
DBVARIANT dbv = { 0 };
if (!db_get_ws(NULL, MODULENAME, "Path", &dbv)) {
- mir_wstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.pwszVal);
db_free(&dbv);
}
else mir_wstrcpy(inBuf, L"splash\\splash.png");
SetDlgItemText(hwndDlg, IDC_SPLASHPATH, inBuf);
if (!db_get_ws(NULL, MODULENAME, "Sound", &dbv)) {
- mir_wstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.pwszVal);
db_free(&dbv);
}
else mir_wstrcpy(inBuf, L"sounds\\startup.wav");
SetDlgItemText(hwndDlg, IDC_SNDPATH, inBuf);
if (!db_get_ws(NULL, MODULENAME, "VersionPrefix", &dbv)) {
- mir_wstrcpy(inBuf, dbv.ptszVal);
+ mir_wstrcpy(inBuf, dbv.pwszVal);
db_free(&dbv);
}
else mir_wstrcpy(inBuf, L"");
diff --git a/plugins/StatusManager/src/aaa_options.cpp b/plugins/StatusManager/src/aaa_options.cpp index 934e550227..612722770d 100644 --- a/plugins/StatusManager/src/aaa_options.cpp +++ b/plugins/StatusManager/src/aaa_options.cpp @@ -83,7 +83,7 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L settings[count]->status = it.iStatus; DBVARIANT dbv; - if (!db_get(0, AAAMODULENAME, StatusModeToDbSetting(it.iStatus, SETTING_STATUSMSG), &dbv)) { + if (!db_get_s(0, AAAMODULENAME, StatusModeToDbSetting(it.iStatus, SETTING_STATUSMSG), &dbv)) { settings[count]->msg = (char*)mir_alloc(mir_strlen(dbv.pszVal) + 1); mir_strcpy(settings[count]->msg, dbv.pszVal); db_free(&dbv); diff --git a/plugins/StatusManager/src/keepstatus.cpp b/plugins/StatusManager/src/keepstatus.cpp index 2fd5caf039..fde639d7e2 100644 --- a/plugins/StatusManager/src/keepstatus.cpp +++ b/plugins/StatusManager/src/keepstatus.cpp @@ -673,7 +673,7 @@ static void CheckContinuouslyFunction(void *) BOOL ping = KSPlugin.getByte(SETTING_BYPING, FALSE); if (ping) { DBVARIANT dbv; - if (db_get(0, KSMODULENAME, SETTING_PINGHOST, &dbv)) + if (db_get_s(0, KSMODULENAME, SETTING_PINGHOST, &dbv)) ping = FALSE; else { char *start, *end; diff --git a/plugins/StatusManager/src/ss_profiles.cpp b/plugins/StatusManager/src/ss_profiles.cpp index c6082e3479..74726c1df2 100644 --- a/plugins/StatusManager/src/ss_profiles.cpp +++ b/plugins/StatusManager/src/ss_profiles.cpp @@ -110,7 +110,7 @@ INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) if (db_get_ws(0, SSMODULENAME, setting, &dbv)) return -1; - wcsncpy(buf, dbv.ptszVal, 128 - 1); buf[127] = 0; + wcsncpy(buf, dbv.pwszVal, 128 - 1); buf[127] = 0; db_free(&dbv); return 0; } diff --git a/plugins/StatusManager/src/ss_toolbars.cpp b/plugins/StatusManager/src/ss_toolbars.cpp index 9e4bce767d..8e0ed7e6cc 100644 --- a/plugins/StatusManager/src/ss_toolbars.cpp +++ b/plugins/StatusManager/src/ss_toolbars.cpp @@ -56,7 +56,7 @@ int CreateTopToolbarButtons(WPARAM, LPARAM) DBVARIANT dbv; mir_snprintf(setting, "%d_%s", i, SETTING_PROFILENAME); - if (db_get(0, SSMODULENAME, setting, &dbv)) + if (db_get_s(0, SSMODULENAME, setting, &dbv)) continue; ttb.hIconHandleDn = iconList[0].hIcolib; diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index 9402597f71..370def4c18 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -20,11 +20,10 @@ wstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, char const * szSetting, wstring errorValue)
{
DBVARIANT dbv;
- //if(db_get(hContact, szModule, szSetting, &dbv))
- if (db_get_ws(hContact, szModule, szSetting, &dbv))
+ if (db_get_ws(hContact, szModule, szSetting, &dbv))
return errorValue;
- // if(DBVT_WCHAR == dbv.type )
- errorValue = dbv.ptszVal;
+
+ errorValue = dbv.pwszVal;
db_free(&dbv);
return errorValue;
}
@@ -32,16 +31,15 @@ wstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szModule, c std::string DBGetContactSettingStringPAN_A(MCONTACT hContact, char const * szModule, char const * szSetting, std::string errorValue)
{
DBVARIANT dbv;
- //if(db_get(hContact, szModule, szSetting, &dbv))
if (db_get_s(hContact, szModule, szSetting, &dbv))
return errorValue;
- // if(DBVT_ASCIIZ == dbv.type )
+
errorValue = dbv.pszVal;
db_free(&dbv);
return errorValue;
}
-wstring &GetDlgItemString(HWND hwnd, int id)
+wstring& GetDlgItemString(HWND hwnd, int id)
{
HWND h = GetDlgItem(hwnd, id);
int len = GetWindowTextLength(h);
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index e9e27412fa..733f760aa3 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -1450,14 +1450,14 @@ panel_found: pContainer->szRelThemeFile[0] = pContainer->szAbsThemeFile[0] = 0;
mir_snprintf(szCname, "%s_theme", CONTAINER_PREFIX);
if (!db_get_ws(pContainer->hContactFrom, SRMSGMOD_T, szCname, &dbv))
- szThemeName = dbv.ptszVal;
+ szThemeName = dbv.pwszVal;
}
else {
Utils::ReadPrivateContainerSettings(pContainer);
if (szThemeName == nullptr) {
mir_snprintf(szCname, "%s%d_theme", CONTAINER_PREFIX, pContainer->iContainerIndex);
if (!db_get_ws(0, SRMSGMOD_T, szCname, &dbv))
- szThemeName = dbv.ptszVal;
+ szThemeName = dbv.pwszVal;
}
}
Utils::SettingsToContainer(pContainer);
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index ffd67d6fda..e5e37e1bd3 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -887,7 +887,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) if (BYTE xStatus = m_dat->m_cache->getXStatusId()) {
wchar_t *tszXStatusName = nullptr;
if (0 == db_get_ws(m_dat->m_cache->getContact(), m_dat->m_cache->getProto(), "XStatusName", &dbv))
- tszXStatusName = dbv.ptszVal;
+ tszXStatusName = dbv.pwszVal;
else if (xStatus > 0 && xStatus <= 31)
tszXStatusName = xStatusDescr[xStatus - 1];
@@ -896,8 +896,8 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) str.AppendFormat(L"%s%s%s", tszXStatusName, m_dat->m_cache->getXStatusMsg() ? L" / " : L"",
m_dat->m_cache->getXStatusMsg() ? m_dat->m_cache->getXStatusMsg() : L"");
- if (dbv.ptszVal)
- mir_free(dbv.ptszVal);
+ if (dbv.pwszVal)
+ mir_free(dbv.pwszVal);
}
}
@@ -905,7 +905,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) str.AppendFormat(TranslateT("\\par\\par\\ul\\b Listening to:\\ul0\\b0 \\par %s"), m_dat->m_cache->getListeningInfo());
if (0 == db_get_ws(m_dat->m_cache->getActiveContact(), m_dat->m_cache->getActiveProto(), "MirVer", &dbv)) {
- str.AppendFormat(TranslateT("\\par\\par\\ul\\b Client:\\ul0\\b0 %s"), dbv.ptszVal);
+ str.AppendFormat(TranslateT("\\par\\par\\ul\\b Client:\\ul0\\b0 %s"), dbv.pwszVal);
::db_free(&dbv);
}
str.AppendChar('}');
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index e8cb510573..4b0e6d8db3 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -174,7 +174,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox) for (int i = 1; i < lr; i++) {
wchar_t *idata = (wchar_t*)SendMessage(hwndCombobox, CB_GETITEMDATA, i, 0);
if (idata && idata != (wchar_t*)CB_ERR) {
- if (!mir_wstrcmpi(dbv.ptszVal, idata)) {
+ if (!mir_wstrcmpi(dbv.pwszVal, idata)) {
SendMessage(hwndCombobox, CB_SETCURSEL, i, 0);
break;
}
diff --git a/plugins/TabSRMM/src/muchighlight.cpp b/plugins/TabSRMM/src/muchighlight.cpp index dd8172921b..e32c086051 100644 --- a/plugins/TabSRMM/src/muchighlight.cpp +++ b/plugins/TabSRMM/src/muchighlight.cpp @@ -50,13 +50,13 @@ void CMUCHighlight::init() m_fInitialized = true;
if (0 == db_get_ws(0, CHAT_MODULE, "HighlightWords", &dbv)) {
- m_TextPatternString = dbv.ptszVal;
+ m_TextPatternString = dbv.pwszVal;
_wsetlocale(LC_ALL, L"");
wcslwr(m_TextPatternString);
}
if (0 == db_get_ws(0, CHAT_MODULE, "HighlightNames", &dbv))
- m_NickPatternString = dbv.ptszVal;
+ m_NickPatternString = dbv.pwszVal;
m_dwFlags = M.GetByte(CHAT_MODULE, "HighlightEnabled", MATCH_TEXT);
m_fHighlightMe = (M.GetByte(CHAT_MODULE, "HighlightMe", 1) ? true : false);
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index fefd3f78df..b82440d908 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -89,7 +89,7 @@ static void LoadTemplatesFrom(TTemplateSet *tSet, MCONTACT hContact, int rtl) if (db_get_ws(hContact, rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[i], &dbv)) continue; if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) - wcsncpy_s(tSet->szTemplates[i], dbv.ptszVal, _TRUNCATE); + wcsncpy_s(tSet->szTemplates[i], dbv.pwszVal, _TRUNCATE); db_free(&dbv); } } diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 0c52cd7f03..cb9db3de87 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -1006,7 +1006,7 @@ void CSkin::setFileName() {
DBVARIANT dbv;
if (0 == db_get_ws(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
- PathToAbsoluteW(dbv.ptszVal, m_tszFileName, M.getSkinPath());
+ PathToAbsoluteW(dbv.pwszVal, m_tszFileName, M.getSkinPath());
db_free(&dbv);
}
else
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index b2060654d7..8b0c73ba99 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -37,7 +37,7 @@ extern int IsTrayProto(const wchar_t *swzProto, BOOL bExtendedTip) DBVARIANT dbv;
int result = 1;
if (!db_get_ws(NULL, MODULENAME, szSetting, &dbv)) {
- result = wcsstr(dbv.ptszVal, swzProto) ? 1 : 0;
+ result = wcsstr(dbv.pwszVal, swzProto) ? 1 : 0;
db_free(&dbv);
}
@@ -100,7 +100,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) if (db_get_ws(0, MODULE_ITEMS, setting, &dbv))
return false;
- wcsncpy(ds->swzName, dbv.ptszVal, _countof(ds->swzName));
+ wcsncpy(ds->swzName, dbv.pwszVal, _countof(ds->swzName));
ds->swzName[_countof(ds->swzName) - 1] = 0;
db_free(&dbv);
@@ -109,7 +109,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) mir_snprintf(setting, "Module%d", index);
ds->szModuleName[0] = 0;
- if (!db_get(0, MODULE_ITEMS, setting, &dbv)) {
+ if (!db_get_s(0, MODULE_ITEMS, setting, &dbv)) {
strncpy(ds->szModuleName, dbv.pszVal, MODULE_NAME_LEN);
ds->szModuleName[MODULE_NAME_LEN - 1] = 0;
db_free(&dbv);
@@ -117,7 +117,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) mir_snprintf(setting, "Setting%d", index);
ds->szSettingName[0] = 0;
- if (!db_get(0, MODULE_ITEMS, setting, &dbv)) {
+ if (!db_get_s(0, MODULE_ITEMS, setting, &dbv)) {
strncpy(ds->szSettingName, dbv.pszVal, SETTING_NAME_LEN);
ds->szSettingName[SETTING_NAME_LEN - 1] = 0;
db_free(&dbv);
@@ -161,14 +161,14 @@ bool LoadDI(DISPLAYITEM *di, int index) if (db_get_ws(0, MODULE_ITEMS, setting, &dbv))
return false;
- wcsncpy(di->swzLabel, dbv.ptszVal, _countof(di->swzLabel));
+ wcsncpy(di->swzLabel, dbv.pwszVal, _countof(di->swzLabel));
di->swzLabel[_countof(di->swzLabel) - 1] = 0;
db_free(&dbv);
mir_snprintf(setting, "DIValue%d", index);
di->swzValue[0] = 0;
if (!db_get_ws(0, MODULE_ITEMS, setting, &dbv)) {
- wcsncpy(di->swzValue, dbv.ptszVal, _countof(di->swzValue));
+ wcsncpy(di->swzValue, dbv.pwszVal, _countof(di->swzValue));
di->swzValue[_countof(di->swzValue) - 1] = 0;
db_free(&dbv);
}
@@ -308,7 +308,7 @@ void LoadObsoleteSkinSetting() opt.transfMode[i] = (TransformationMode)db_get_b(0, MODULENAME, setting, 0);
mir_snprintf(setting, "SImgFile%d", i);
if (!db_get_ws(NULL, MODULENAME, setting, &dbv)) {
- opt.szImgFile[i] = mir_wstrdup(dbv.ptszVal);
+ opt.szImgFile[i] = mir_wstrdup(dbv.pwszVal);
db_free(&dbv);
}
@@ -514,7 +514,7 @@ void LoadOptions() }
else if (opt.skinMode == SM_IMAGE) {
if (!db_get_ws(NULL, MODULENAME, "SkinName", &dbv)) {
- wcsncpy(opt.szSkinName, dbv.ptszVal, _countof(opt.szSkinName) - 1);
+ wcsncpy(opt.szSkinName, dbv.pwszVal, _countof(opt.szSkinName) - 1);
db_free(&dbv);
}
}
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 2e6fd15826..34a7bde2cb 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -221,8 +221,8 @@ wchar_t* GetStatusMessageText(MCONTACT hContact) return nullptr; if (!db_get_ws(hContact, MODULENAME, "TempStatusMsg", &dbv)) { - if (mir_wstrlen(dbv.ptszVal) != 0) - swzMsg = mir_wstrdup(dbv.ptszVal); + if (mir_wstrlen(dbv.pwszVal) != 0) + swzMsg = mir_wstrdup(dbv.pwszVal); db_free(&dbv); } } @@ -233,8 +233,8 @@ wchar_t* GetStatusMessageText(MCONTACT hContact) return nullptr; if (!db_get_ws(hContact, "CList", "StatusMsg", &dbv)) { - if (mir_wstrlen(dbv.ptszVal) != 0) - swzMsg = mir_wstrdup(dbv.ptszVal); + if (mir_wstrlen(dbv.pwszVal) != 0) + swzMsg = mir_wstrdup(dbv.pwszVal); db_free(&dbv); } } diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index 8a487fd6a2..999585bd3e 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -523,7 +523,7 @@ wchar_t *EmptyXStatusToDefaultName(MCONTACT hContact, const char *szModuleName, if (ProtoServiceExists(szModuleName, "/SendXML")) // jabber protocol?
{
if (!db_get_ws(hContact, szModuleName, szSettingName, &dbv)) {
- wcsncpy(buff, TranslateW(dbv.ptszVal), bufflen);
+ wcsncpy(buff, TranslateW(dbv.pwszVal), bufflen);
buff[bufflen - 1] = 0;
return buff;
}
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index e4396b265e..c057cf202c 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -637,7 +637,7 @@ int MAnnivDate::DBGetAnniversaryDate(MCONTACT hContact, WORD iIndex) mir_snprintf(szStamp, "Anniv%dDesc", iIndex);
DBVARIANT dbv;
if (!DB::Setting::GetTString(hContact, USERINFO, szStamp, &dbv)) {
- _strDesc = dbv.ptszVal;
+ _strDesc = dbv.pwszVal;
db_free(&dbv);
}
}
diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index ff72aa2933..18463b0f99 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -245,7 +245,7 @@ int CPsTreeItem::ItemLabel(const BYTE bReadDBValue) mir_free(_ptszLabel);
// try to get custom label from database
- if (!bReadDBValue || DB::Setting::GetTString(NULL, MODULENAME, GlobalPropertyKey(SET_ITEM_LABEL), &dbv) || (_ptszLabel = dbv.ptszVal) == nullptr) {
+ if (!bReadDBValue || DB::Setting::GetTString(NULL, MODULENAME, GlobalPropertyKey(SET_ITEM_LABEL), &dbv) || (_ptszLabel = dbv.pwszVal) == nullptr) {
// extract the name
LPSTR pszName = mir_strrchr(_pszName, '\\');
if (pszName && pszName[1])
diff --git a/plugins/UserInfoEx/src/ctrl_combo.cpp b/plugins/UserInfoEx/src/ctrl_combo.cpp index cf4a7b6366..2afbbdc00b 100644 --- a/plugins/UserInfoEx/src/ctrl_combo.cpp +++ b/plugins/UserInfoEx/src/ctrl_combo.cpp @@ -158,7 +158,7 @@ BOOL CCombo::OnInfoChanged(MCONTACT hContact, LPCSTR pszProto) case DBVT_WORD: iVal = Find((int)dbv.wVal); break;
case DBVT_DWORD: iVal = Find((int)dbv.dVal); break;
case DBVT_WCHAR:
- iVal = Find(TranslateW(dbv.ptszVal));
+ iVal = Find(TranslateW(dbv.pwszVal));
if (iVal == CB_ERR) {
// other
iVal = Find(_pList[_nList - 1].nID);
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index 1254d743c1..84de9f555f 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -1297,7 +1297,7 @@ int CtrlContactAddItemFromDB( if (cbi.wFlags == CBEXIF_CATREADONLY)
cbi.pszVal = nullptr;
else { // check the database value
- cbi.pszVal = dbv.ptszVal;
+ cbi.pszVal = dbv.pwszVal;
if (LPTSTR sms = wcsstr(cbi.pszVal, L" SMS")) {
cbi.wFlags |= CBEXIF_SMS;
*sms = 0;
@@ -1356,9 +1356,9 @@ int CtrlContactAddMyItemsFromDB( {
// read value
cbi.dwID = hashSetting(pszSetting);
- cbi.pszVal = dbv.ptszVal;
+ cbi.pszVal = dbv.pwszVal;
dbv.type = DBVT_DELETED;
- dbv.ptszVal = nullptr;
+ dbv.pwszVal = nullptr;
// read category
if (SUCCEEDED(mir_snprintf(pszSetting, szFormatCat, i))) {
@@ -1372,10 +1372,10 @@ int CtrlContactAddMyItemsFromDB( dbv.type = DBVT_DELETED;
}
- if (dbv.type > DBVT_DELETED && dbv.ptszVal && *dbv.ptszVal) {
- cbi.pszCat = dbv.ptszVal;
+ if (dbv.type > DBVT_DELETED && dbv.pwszVal && *dbv.pwszVal) {
+ cbi.pszCat = dbv.pwszVal;
dbv.type = DBVT_DELETED;
- dbv.ptszVal = nullptr;
+ dbv.pwszVal = nullptr;
}
}
if (sms = wcsstr(cbi.pszVal, L" SMS")) {
diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp index 6fb2c20d43..51a1a19607 100644 --- a/plugins/UserInfoEx/src/ctrl_edit.cpp +++ b/plugins/UserInfoEx/src/ctrl_edit.cpp @@ -137,9 +137,9 @@ BOOL CEditCtrl::OnInfoChanged(MCONTACT hContact, LPCSTR pszProto) break; case DBVT_WCHAR: - if (dbv.ptszVal) { - SetWindowText(_hwnd, dbv.ptszVal); - _pszValue = dbv.ptszVal; + if (dbv.pwszVal) { + SetWindowText(_hwnd, dbv.pwszVal); + _pszValue = dbv.pwszVal; break; } @@ -191,7 +191,7 @@ void CEditCtrl::OnApply(MCONTACT hContact, LPCSTR pszProto) break; case DBVT_WCHAR: - dbv.ptszVal = val; + dbv.pwszVal = val; break; default: diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 55a471a088..397b781284 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -1049,7 +1049,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (!pPs->hContact)
pszName = TranslateT("Owner");
else if (pdbcws && pdbcws->value.type == DBVT_WCHAR)
- pszName = pdbcws->value.ptszVal;
+ pszName = pdbcws->value.pwszVal;
else
pszName = Clist_GetContactDisplayName(pPs->hContact);
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index 85e34efec7..1123c8ad51 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -506,7 +506,7 @@ static int ProfileList_AddItemlistFromDB( pItem->idstrListCount = nList;
pItem->iListItem = 0;
pItem->pszText[0] = nullptr;
- pItem->pszText[1] = dbvVal.ptszVal;
+ pItem->pszText[1] = dbvVal.pwszVal;
pItem->wFlags = wFlags;
lvi.lParam = (LPARAM)pItem;
diff --git a/plugins/Variables/src/options.cpp b/plugins/Variables/src/options.cpp index 8a528b39b8..8cac54f7a7 100644 --- a/plugins/Variables/src/options.cpp +++ b/plugins/Variables/src/options.cpp @@ -27,7 +27,7 @@ static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA {
DBVARIANT dbv;
if (!db_get_ws( NULL, MODULENAME, SETTING_STARTUPTEXT, &dbv )) {
- SetDlgItemText(hwndDlg, IDC_FORMATTEXT, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_FORMATTEXT, dbv.pwszVal);
db_free(&dbv);
}
}
diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index fdc28202b9..367dd686c8 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -45,7 +45,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) DBVARIANT dbv;
// check ID to see if the contact already exist in the database
if (!db_get_ws(hContact, WEATHERPROTONAME, "ID", &dbv)) {
- if (!mir_wstrcmpi(psr->email.w, dbv.ptszVal)) {
+ if (!mir_wstrcmpi(psr->email.w, dbv.pwszVal)) {
// remove the flag for not on list and hidden, thus make the contact visible
// and add them on the list
if (db_get_b(hContact, "CList", "NotOnList", 1)) {
@@ -109,7 +109,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) opt.DefStn = hContact;
if (!db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
// notification message box
- mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
+ mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.pwszVal);
db_free(&dbv);
MessageBox(nullptr, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 5fdb1d097d..62fdf93ffc 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -43,7 +43,7 @@ INT_PTR ViewLog(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
if (!db_get_ws(wParam, WEATHERPROTONAME, "Log", &dbv)) {
if (dbv.pszVal[0] != 0)
- ShellExecute((HWND)lParam, L"open", dbv.ptszVal, L"", L"", SW_SHOW);
+ ShellExecute((HWND)lParam, L"open", dbv.pwszVal, L"", L"", SW_SHOW);
db_free(&dbv);
}
else // display warning dialog if no path is specified
@@ -159,19 +159,19 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA // start to get the settings
// if the setting not exist, leave the dialog box blank
if (!db_get_ws(hContact, WEATHERPROTONAME, "ID", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_ID, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_ID, dbv.pwszVal);
// check if the station is a default station
- CheckDlgButton(hwndDlg, IDC_DEFA, mir_wstrcmp(dbv.ptszVal, opt.Default) != 0 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DEFA, mir_wstrcmp(dbv.pwszVal, opt.Default) != 0 ? BST_CHECKED : BST_UNCHECKED);
db_free(&dbv);
}
if (!db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_NAME, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_NAME, dbv.pwszVal);
db_free(&dbv);
}
if (!db_get_ws(hContact, WEATHERPROTONAME, "Log", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_LOG, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_LOG, dbv.pwszVal);
// if the log path is not empty, check the checkbox for external log
- if (dbv.ptszVal[0]) CheckDlgButton(hwndDlg, IDC_External, BST_CHECKED);
+ if (dbv.pwszVal[0]) CheckDlgButton(hwndDlg, IDC_External, BST_CHECKED);
db_free(&dbv);
}
// enable/disable the browse button depending on the value of external log checkbox
@@ -183,11 +183,11 @@ static INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPA CheckDlgButton(hwndDlg, IDC_Internal, db_get_b(hContact, WEATHERPROTONAME, "History", 0) ? BST_CHECKED : BST_UNCHECKED);
if (!db_get_ws(hContact, WEATHERPROTONAME, "InfoURL", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_IURL, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_IURL, dbv.pwszVal);
db_free(&dbv);
}
if (!db_get_ws(hContact, WEATHERPROTONAME, "MapURL", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_MURL, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_MURL, dbv.pwszVal);
db_free(&dbv);
}
diff --git a/plugins/Weather/src/weather_conv.cpp b/plugins/Weather/src/weather_conv.cpp index c58751a072..27b8569ccf 100644 --- a/plugins/Weather/src/weather_conv.cpp +++ b/plugins/Weather/src/weather_conv.cpp @@ -547,8 +547,8 @@ wchar_t* GetDisplay(WEATHERINFO *w, const wchar_t *dis, wchar_t* str) }
// access the database to get its value
if (!db_get_ws(w->hContact, WEATHERCONDITION, name, &dbv)) {
- if (dbv.ptszVal != TranslateW(NODATA) && dbv.ptszVal != TranslateT("<Error>"))
- mir_wstrcat(str, dbv.ptszVal);
+ if (dbv.pwszVal != TranslateW(NODATA) && dbv.pwszVal != TranslateT("<Error>"))
+ mir_wstrcat(str, dbv.pwszVal);
db_free(&dbv);
}
break;
diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index cc3fcbbf27..8137b19c0d 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -131,7 +131,7 @@ void EraseAllInfo() db_set_b(hContact, WEATHERPROTONAME, "IsUpdated", FALSE);
// reset logging settings
if (!db_get_ws(hContact, WEATHERPROTONAME, "Log", &dbv)) {
- db_set_b(hContact, WEATHERPROTONAME, "File", (BYTE)(dbv.ptszVal[0] != 0));
+ db_set_b(hContact, WEATHERPROTONAME, "File", (BYTE)(dbv.pwszVal[0] != 0));
db_free(&dbv);
}
else db_set_b(hContact, WEATHERPROTONAME, "File", FALSE);
@@ -142,7 +142,7 @@ void EraseAllInfo() opt.DefStn = hContact;
if (!db_get_ws(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
- mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
+ mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.pwszVal);
db_free(&dbv);
MessageBox(nullptr, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
@@ -150,7 +150,7 @@ void EraseAllInfo() // get the handle of the default station
if (opt.DefStn == NULL) {
if (!db_get_ws(hContact, WEATHERPROTONAME, "ID", &dbv)) {
- if (!mir_wstrcmp(dbv.ptszVal, opt.Default))
+ if (!mir_wstrcmp(dbv.pwszVal, opt.Default))
opt.DefStn = hContact;
db_free(&dbv);
}
@@ -164,12 +164,12 @@ void EraseAllInfo() // in case where the default station is missing
if (opt.DefStn == NULL && ContactCount != 0) {
if (!db_get_ws(LastContact, WEATHERPROTONAME, "ID", &dbv)) {
- wcsncpy(opt.Default, dbv.ptszVal, _countof(opt.Default) - 1);
+ wcsncpy(opt.Default, dbv.pwszVal, _countof(opt.Default) - 1);
db_free(&dbv);
}
opt.DefStn = LastContact;
if (!db_get_ws(LastContact, WEATHERPROTONAME, "Nick", &dbv)) {
- mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
+ mir_snwprintf(str, TranslateT("%s is now the default weather station"), dbv.pwszVal);
db_free(&dbv);
MessageBox(nullptr, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index f2181b8475..7208b267df 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -234,7 +234,7 @@ static void addWindow(MCONTACT hContact) return;
wchar_t winname[512];
- mir_snwprintf(winname, L"Weather: %s", dbv.ptszVal);
+ mir_snwprintf(winname, L"Weather: %s", dbv.pwszVal);
db_free(&dbv);
HWND hWnd = CreateWindow(L"WeatherFrame", L"", WS_CHILD | WS_VISIBLE,
diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index 6a3351c463..df1b3af7fd 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -175,7 +175,7 @@ static void __cdecl WeatherGetAwayMsgThread(void *arg) MCONTACT hContact = (DWORD_PTR)arg;
DBVARIANT dbv;
if (!db_get_ws(hContact, "CList", "StatusMsg", &dbv)) {
- ProtoBroadcastAck(WEATHERPROTONAME, hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
+ ProtoBroadcastAck(WEATHERPROTONAME, hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.pwszVal);
db_free(&dbv);
}
else ProtoBroadcastAck(WEATHERPROTONAME, hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, 0);
diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index 3b616388f2..81c9da2ac1 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -57,7 +57,7 @@ int UpdateWeather(MCONTACT hContact) if (opt.ShowWarnings) {
// show warnings by popup
mir_snwprintf(str, _countof(str) - 105,
- TranslateT("Unable to retrieve weather information for %s"), dbv.ptszVal);
+ TranslateT("Unable to retrieve weather information for %s"), dbv.pwszVal);
mir_wstrncat(str, L"\n", _countof(str) - mir_wstrlen(str));
wchar_t *tszError = GetError(code);
mir_wstrncat(str, tszError, _countof(str) - mir_wstrlen(str));
@@ -66,7 +66,7 @@ int UpdateWeather(MCONTACT hContact) }
// log to netlib
Netlib_LogfW(hNetlibUser, L"Error! Update cannot continue... Start to free memory");
- Netlib_LogfW(hNetlibUser, L"<-- Error occurs while updating station: %s -->", dbv.ptszVal);
+ Netlib_LogfW(hNetlibUser, L"<-- Error occurs while updating station: %s -->", dbv.pwszVal);
if (!dbres) db_free(&dbv);
return 1;
}
@@ -81,19 +81,19 @@ int UpdateWeather(MCONTACT hContact) // compare the old condition and determine if the weather had changed
if (opt.UpdateOnlyConditionChanged) { // consider condition change
if (!db_get_ws(hContact, WEATHERPROTONAME, "LastCondition", &dbv)) {
- if (mir_wstrcmpi(winfo.cond, dbv.ptszVal)) Ch = TRUE; // the weather condition is changed
+ if (mir_wstrcmpi(winfo.cond, dbv.pwszVal)) Ch = TRUE; // the weather condition is changed
db_free(&dbv);
}
else Ch = TRUE;
if (!db_get_ws(hContact, WEATHERPROTONAME, "LastTemperature", &dbv)) {
- if (mir_wstrcmpi(winfo.temp, dbv.ptszVal)) Ch = TRUE; // the temperature is changed
+ if (mir_wstrcmpi(winfo.temp, dbv.pwszVal)) Ch = TRUE; // the temperature is changed
db_free(&dbv);
}
else Ch = TRUE;
}
else { // consider update time change
if (!db_get_ws(hContact, WEATHERPROTONAME, "LastUpdate", &dbv)) {
- if (mir_wstrcmpi(winfo.update, dbv.ptszVal)) Ch = TRUE; // the update time is changed
+ if (mir_wstrcmpi(winfo.update, dbv.pwszVal)) Ch = TRUE; // the update time is changed
db_free(&dbv);
}
else Ch = TRUE;
@@ -101,10 +101,10 @@ int UpdateWeather(MCONTACT hContact) // have weather alert issued?
dbres = db_get_ws(hContact, WEATHERCONDITION, "Alert", &dbv);
- if (!dbres && dbv.ptszVal[0] != 0) {
+ if (!dbres && dbv.pwszVal[0] != 0) {
if (opt.AlertPopup && !db_get_b(hContact, WEATHERPROTONAME, "DPopUp", 0) && Ch) {
// display alert popup
- mir_snwprintf(str, L"Alert for %s%c%s", winfo.city, 255, dbv.ptszVal);
+ mir_snwprintf(str, L"Alert for %s%c%s", winfo.city, 255, dbv.pwszVal);
WPShowMessage(str, SM_WEATHERALERT);
}
// alert issued, set display to italic
@@ -169,10 +169,10 @@ int UpdateWeather(MCONTACT hContact) if (!db_get_ws(hContact, WEATHERPROTONAME, "Log", &dbv)) {
// for the option for overwriting the file, delete old file first
if (db_get_b(hContact, WEATHERPROTONAME, "Overwrite", 0))
- DeleteFile(dbv.ptszVal);
+ DeleteFile(dbv.pwszVal);
// open the file and set point to the end of file
- FILE *file = _wfopen(dbv.ptszVal, L"a");
+ FILE *file = _wfopen(dbv.pwszVal, L"a");
db_free(&dbv);
if (file != nullptr) {
// write data to the file and close
@@ -486,7 +486,7 @@ int GetWeatherData(MCONTACT hContact) case '[': // variable, add the value to the result string
hasvar = TRUE;
if (!DBGetData(hContact, _T2A(str2), &dbv)) {
- mir_wstrncat(DataValue, dbv.ptszVal, _countof(DataValue) - mir_wstrlen(DataValue));
+ mir_wstrncat(DataValue, dbv.pwszVal, _countof(DataValue) - mir_wstrlen(DataValue));
DataValue[_countof(DataValue) - 1] = 0;
db_free(&dbv);
}
@@ -510,7 +510,7 @@ int GetWeatherData(MCONTACT hContact) // for the "Break Data=" operation
DBVARIANT dbv;
if (!DBGetData(hContact, _T2A(Item->Item.Start), &dbv)) {
- wcsncpy(DataValue, dbv.ptszVal, _countof(DataValue));
+ wcsncpy(DataValue, dbv.pwszVal, _countof(DataValue));
DataValue[_countof(DataValue) - 1] = 0;
db_free(&dbv);
}
diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index d00e473a66..2be23ed09a 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -239,7 +239,7 @@ int SendToRichEdit(HWND hWindow, char *truncated, COLORREF rgbText, COLORREF rgb cfFM.dwEffects = bold | italic | underline;
if (!db_get_ws(NULL, MODULENAME, FONT_FACE_KEY, &dbv)) {
- mir_wstrcpy(cfFM.szFaceName, dbv.ptszVal);
+ mir_wstrcpy(cfFM.szFaceName, dbv.pwszVal);
db_free(&dbv);
}
else mir_wstrcpy(cfFM.szFaceName, Def_font_face);
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index 2cf0cdaf5a..ad281c4b3c 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -116,7 +116,7 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) if( ((HANDLE)wParam) != nullptr) {
DBVARIANT dbv;
db_get_ws(wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv);
- mir_wstrncpy(ppd.lptzContactName, dbv.ptszVal, _countof(ppd.lptzContactName));
+ mir_wstrncpy(ppd.lptzContactName, dbv.pwszVal, _countof(ppd.lptzContactName));
db_free(&dbv);
}
else mir_wstrcpy(ppd.lptzContactName, _A2W(MODULENAME));
diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index 19b600d481..4b70e7c2cb 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -162,7 +162,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA url[0] = '\0';
if (!db_get_ws(hContact2, MODULENAME, URL_KEY, &dbv)) {
- wcsncpy_s(url, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(url, dbv.pwszVal, _TRUNCATE);
db_free(&dbv);
}
SetDlgItemText(hwndDlg, IDC_OPEN_URL, FixButtonText(url, _countof(url)));
diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index 7340f6a58c..3d8a3db19c 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -298,7 +298,7 @@ void GetData(void *param) if (db_get_b(hContact, MODULENAME, USE_24_HOUR_KEY, 0) == 1)
strftime(temptime, 128, "(%b %d,%H:%M:%S)", nTime);
- db_set_ws(hContact, MODULENAME, PRESERVE_NAME_KEY, dbv.ptszVal);
+ db_set_ws(hContact, MODULENAME, PRESERVE_NAME_KEY, dbv.pwszVal);
if (db_get_b(hContact, MODULENAME, CONTACT_PREFIX_KEY, 1) == 1)
mir_snprintf(tstr, "%s %s", temptime, dbv.pszVal);
if (db_get_b(hContact, MODULENAME, CONTACT_PREFIX_KEY, 1) == 0)
diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp index 3573ead3c2..27091fd65b 100644 --- a/plugins/WebView/src/webview_opts.cpp +++ b/plugins/WebView/src/webview_opts.cpp @@ -279,15 +279,15 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l EnableWindow(GetDlgItem(hwndDlg, IDC_ALERT_APPLY), 0);
if (!db_get_ws(hContact, MODULENAME, ALERT_STRING_KEY, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_ALERT_STRING, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_ALERT_STRING, dbv.pwszVal);
db_free(&dbv);
}
if (!db_get_ws(hContact, MODULENAME, ALRT_S_STRING_KEY, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_START2, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_START2, dbv.pwszVal);
db_free(&dbv);
}
if (!db_get_ws(hContact, MODULENAME, ALRT_E_STRING_KEY, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_END2, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_END2, dbv.pwszVal);
db_free(&dbv);
}
CheckDlgButton(hwndDlg, IDC_ENABLE_ALERTS, db_get_b(hContact, MODULENAME, ENABLE_ALERTS_KEY, 0) ? BST_CHECKED : BST_UNCHECKED);
@@ -408,7 +408,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
if (!db_get_ws(hContact, MODULENAME, FILE_KEY, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_FILENAME, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_FILENAME, dbv.pwszVal);
db_free(&dbv);
}
@@ -801,25 +801,25 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_APPLY), 0);
if (!db_get_ws(hContact, MODULENAME, URL_KEY, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_URL, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_URL, dbv.pwszVal);
db_free(&dbv);
}
if (!db_get_ws(hContact, MODULENAME, START_STRING_KEY, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_START, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_START, dbv.pwszVal);
db_free(&dbv);
}
if (!db_get_ws(hContact, MODULENAME, END_STRING_KEY, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_END, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_END, dbv.pwszVal);
db_free(&dbv);
}
if (db_get_ws(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
db_free(&dbv);
db_get_ws(hContact, "CList", "MyHandle", &dbv);
- db_set_ws(hContact, MODULENAME, PRESERVE_NAME_KEY, dbv.ptszVal);
+ db_set_ws(hContact, MODULENAME, PRESERVE_NAME_KEY, dbv.pwszVal);
db_free(&dbv);
}
if (!db_get_ws(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_SITE_NAME, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_SITE_NAME, dbv.pwszVal);
db_free(&dbv);
}
@@ -1063,7 +1063,7 @@ INT_PTR CALLBACK DlgProcOpt(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara CheckDlgButton(hwndDlg, IDC_DATAPOPUP, db_get_b(NULL, MODULENAME, DATA_POPUP_KEY, 0) ? BST_CHECKED : BST_UNCHECKED);
if (!db_get_ws(NULL, MODULENAME, FONT_FACE_KEY, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_TYPEFACE, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_TYPEFACE, dbv.pwszVal);
db_free(&dbv);
}
else SetDlgItemText(hwndDlg, IDC_TYPEFACE, Def_font_face);
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp index 5830d5ea65..229583a1e8 100644 --- a/plugins/WebView/src/webview_services.cpp +++ b/plugins/WebView/src/webview_services.cpp @@ -347,7 +347,7 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) // check ID to see if the contact already exist in the database if (db_get_ws(hContact, MODULENAME, "URL", &dbv)) continue; - if (!mir_wstrcmpi(psr->nick.w, dbv.ptszVal)) { + if (!mir_wstrcmpi(psr->nick.w, dbv.pwszVal)) { // remove the flag for not on list and hidden, thus make the // contact visible // and add them on the list @@ -398,7 +398,7 @@ INT_PTR AddToList(WPARAM, LPARAM lParam) for (auto &hContact2 : Contacts(MODULENAME)) { if (!db_get_ws(hContact2, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { - if (!mir_wstrcmpi(Newnick, dbv.ptszVal)) { + if (!mir_wstrcmpi(Newnick, dbv.pwszVal)) { // remove the flag for not on list and hidden, thus make the // contact visible // and add them on the list diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index 2ebbb5f7ef..e2876ae1c7 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -36,7 +36,7 @@ void LoadOptions() dbv.type = DBVT_WCHAR;
memset(&WumfOptions, 0, sizeof(WumfOptions));
if (db_get_ws(NULL, MODULENAME, OPT_FILE, &dbv) == 0) {
- wcsncpy(WumfOptions.LogFile, dbv.ptszVal, 255);
+ wcsncpy(WumfOptions.LogFile, dbv.pwszVal, 255);
db_free(&dbv);
}
else
diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp index 32754d42c2..110e72a6d5 100644 --- a/plugins/XSoundNotify/src/dialog.cpp +++ b/plugins/XSoundNotify/src/dialog.cpp @@ -55,7 +55,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP if (!db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_BUTTON_TEST_PLAY), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CONT_BUTTON_RESET_SOUND), TRUE);
- SetDlgItemText(hwndDlg, IDC_CONT_LABEL_SOUND, PathFindFileName(dbv.ptszVal));
+ SetDlgItemText(hwndDlg, IDC_CONT_LABEL_SOUND, PathFindFileName(dbv.pwszVal));
db_free(&dbv);
}
else {
@@ -136,7 +136,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP DBVARIANT dbv;
if (!db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
wchar_t longpath[MAX_PATH] = { 0 };
- PathToAbsoluteW(dbv.ptszVal, longpath);
+ PathToAbsoluteW(dbv.pwszVal, longpath);
Skin_PlaySoundFile(longpath);
db_free(&dbv);
}
@@ -169,7 +169,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP DBVARIANT dbv;
if (!db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
wchar_t longpath[MAX_PATH];
- PathToAbsoluteW(dbv.ptszVal, longpath);
+ PathToAbsoluteW(dbv.pwszVal, longpath);
XSN_Users.insert(new XSN_Data(hContact, longpath, IsDlgButtonChecked(hwndDlg, IDC_CONT_IGNORE_SOUND) ? 1 : 0, 1));
db_free(&dbv);
}
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index 32e14c5569..bbbad8fe54 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -100,7 +100,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (!db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_TEST_PLAY), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_RESET_SOUND), TRUE);
- SetDlgItemText(hwndDlg, IDC_OPT_LABEL_SOUND, PathFindFileName(dbv.ptszVal));
+ SetDlgItemText(hwndDlg, IDC_OPT_LABEL_SOUND, PathFindFileName(dbv.pwszVal));
db_free(&dbv);
}
else {
@@ -120,7 +120,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (!db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_TEST_PLAY), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_RESET_SOUND), TRUE);
- SetDlgItemText(hwndDlg, IDC_OPT_LABEL_SOUND, PathFindFileName(dbv.ptszVal));
+ SetDlgItemText(hwndDlg, IDC_OPT_LABEL_SOUND, PathFindFileName(dbv.pwszVal));
db_free(&dbv);
}
else {
@@ -202,7 +202,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l DBVARIANT dbv;
if (!db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
wchar_t longpath[MAX_PATH];
- PathToAbsoluteW(dbv.ptszVal, longpath);
+ PathToAbsoluteW(dbv.pwszVal, longpath);
Skin_PlaySoundFile(longpath);
db_free(&dbv);
}
@@ -221,7 +221,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l DBVARIANT dbv;
if (!db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
wchar_t longpath[MAX_PATH];
- PathToAbsoluteW(dbv.ptszVal, longpath);
+ PathToAbsoluteW(dbv.pwszVal, longpath);
Skin_PlaySoundFile(longpath);
db_free(&dbv);
}
@@ -281,7 +281,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l DBVARIANT dbv;
if (!db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
wchar_t longpath[MAX_PATH];
- PathToAbsoluteW(dbv.ptszVal, longpath);
+ PathToAbsoluteW(dbv.pwszVal, longpath);
XSN_Users.insert(new XSN_Data((LPARAM)pa->szModuleName, longpath, IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0, 0));
db_free(&dbv);
}
@@ -297,7 +297,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l DBVARIANT dbv;
if (!db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
wchar_t longpath[MAX_PATH];
- PathToAbsoluteW(dbv.ptszVal, longpath);
+ PathToAbsoluteW(dbv.pwszVal, longpath);
XSN_Users.insert(new XSN_Data(hContact, longpath, IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0, 1));
db_free(&dbv);
}
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index bb7e1ecb2f..c29a1ea852 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -108,7 +108,7 @@ static int ProcessEvent(WPARAM hContact, LPARAM lParam) DBVARIANT dbv;
if (!isIgnoreSound && !db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
wchar_t PlaySoundPath[MAX_PATH] = { 0 };
- PathToAbsoluteW(dbv.ptszVal, PlaySoundPath);
+ PathToAbsoluteW(dbv.pwszVal, PlaySoundPath);
isOwnSound = 0;
Skin_PlaySoundFile(PlaySoundPath);
db_free(&dbv);
@@ -125,7 +125,7 @@ static int ProcessEvent(WPARAM hContact, LPARAM lParam) mir_free(value);
if (!isIgnoreAccSound && !db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
wchar_t PlaySoundPath[MAX_PATH] = { 0 };
- PathToAbsoluteW(dbv.ptszVal, PlaySoundPath);
+ PathToAbsoluteW(dbv.pwszVal, PlaySoundPath);
isAccSound = 0;
Skin_PlaySoundFile(PlaySoundPath);
db_free(&dbv);
@@ -153,7 +153,7 @@ static int ProcessChatEvent(WPARAM, LPARAM lParam) DBVARIANT dbv;
if (!isIgnoreSound && !db_get_ws(hContact, MODULENAME, SETTINGSKEY, &dbv)) {
wchar_t PlaySoundPath[MAX_PATH] = { 0 };
- PathToAbsoluteW(dbv.ptszVal, PlaySoundPath);
+ PathToAbsoluteW(dbv.pwszVal, PlaySoundPath);
isOwnSound = 0;
Skin_PlaySoundFile(PlaySoundPath);
db_free(&dbv);
@@ -169,7 +169,7 @@ static int ProcessChatEvent(WPARAM, LPARAM lParam) mir_free(value);
if (!isIgnoreAccSound && !db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
wchar_t PlaySoundPath[MAX_PATH] = { 0 };
- PathToAbsoluteW(dbv.ptszVal, PlaySoundPath);
+ PathToAbsoluteW(dbv.pwszVal, PlaySoundPath);
isAccSound = 0;
Skin_PlaySoundFile(PlaySoundPath);
db_free(&dbv);
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index a1aed2bf90..d3b093e8d9 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -806,7 +806,7 @@ LRESULT CALLBACK NewMailPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa hContact = PUGetContact(hWnd); - if (!db_get(hContact, YAMN_DBMODULE, "Id", &dbv)) { + if (!db_get_s(hContact, YAMN_DBMODULE, "Id", &dbv)) { Account = (HACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal); db_free(&dbv); } @@ -870,7 +870,7 @@ LRESULT CALLBACK NewMailPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa MCONTACT hContact = PUGetContact(hWnd); - if (!db_get(hContact, YAMN_DBMODULE, "Id", &dbv)) { + if (!db_get_s(hContact, YAMN_DBMODULE, "Id", &dbv)) { ActualAccount = (HACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal); db_free(&dbv); } @@ -899,7 +899,7 @@ LRESULT CALLBACK NoNewMailPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l MCONTACT hContact = PUGetContact(hWnd); - if (!db_get(hContact, YAMN_DBMODULE, "Id", &dbv)) { + if (!db_get_s(hContact, YAMN_DBMODULE, "Id", &dbv)) { ActualAccount = (HACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal); db_free(&dbv); } @@ -962,7 +962,7 @@ LRESULT CALLBACK NoNewMailPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l MCONTACT hContact = PUGetContact(hWnd); - if (!db_get(hContact, YAMN_DBMODULE, "Id", &dbv)) { + if (!db_get_s(hContact, YAMN_DBMODULE, "Id", &dbv)) { ActualAccount = (HACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal); db_free(&dbv); } diff --git a/plugins/YAMN/src/services.cpp b/plugins/YAMN/src/services.cpp index 51534dd388..c8517bda3e 100644 --- a/plugins/YAMN/src/services.cpp +++ b/plugins/YAMN/src/services.cpp @@ -5,9 +5,9 @@ static INT_PTR Service_GetCaps(WPARAM wParam, LPARAM) if (wParam == PFLAGNUM_4)
return PF4_NOCUSTOMAUTH;
if (wParam == PFLAG_UNIQUEIDTEXT)
- return (INT_PTR) Translate("Nick");
+ return (INT_PTR)Translate("Nick");
if (wParam == PFLAG_MAXLENOFMESSAGE)
- return 400;
+ return 400;
if (wParam == PFLAGNUM_2)
return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND;
if (wParam == PFLAGNUM_5) {
@@ -20,12 +20,12 @@ static INT_PTR Service_GetCaps(WPARAM wParam, LPARAM) static INT_PTR Service_GetStatus(WPARAM, LPARAM)
{
- return YAMN_STATUS;
+ return YAMN_STATUS;
}
static INT_PTR Service_SetStatus(WPARAM wParam, LPARAM)
-{
- int newstatus = (wParam != ID_STATUS_OFFLINE)?ID_STATUS_ONLINE:ID_STATUS_OFFLINE;
+{
+ int newstatus = (wParam != ID_STATUS_OFFLINE) ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE;
if (newstatus != YAMN_STATUS) {
int oldstatus = YAMN_STATUS;
YAMN_STATUS = newstatus;
@@ -37,18 +37,18 @@ static INT_PTR Service_SetStatus(WPARAM wParam, LPARAM) static INT_PTR Service_GetName(WPARAM wParam, LPARAM lParam)
{
- mir_strncpy((char *) lParam, YAMN_DBMODULE, wParam);
+ mir_strncpy((char *)lParam, YAMN_DBMODULE, wParam);
return 0;
}
static INT_PTR Service_LoadIcon(WPARAM wParam, LPARAM)
{
- if ( LOWORD( wParam ) == PLI_PROTOCOL )
+ if (LOWORD(wParam) == PLI_PROTOCOL)
return (INT_PTR)CopyIcon(g_LoadIconEx(0)); // noone cares about other than PLI_PROTOCOL
return (INT_PTR)(HICON)NULL;
}
-
+
INT_PTR ClistContactDoubleclicked(WPARAM, LPARAM lParam)
{
ContactDoubleclicked(((CLISTEVENT*)lParam)->lParam, lParam);
@@ -64,32 +64,32 @@ static int Service_ContactDoubleclicked(WPARAM wParam, LPARAM lParam) static INT_PTR ContactApplication(WPARAM wParam, LPARAM)
{
char *szProto = GetContactProto(wParam);
- if ( mir_strcmp(szProto, YAMN_DBMODULE))
+ if (mir_strcmp(szProto, YAMN_DBMODULE))
return 0;
DBVARIANT dbv;
- if ( db_get(wParam, YAMN_DBMODULE, "Id", &dbv))
+ if (db_get_s(wParam, YAMN_DBMODULE, "Id", &dbv))
return 0;
- HACCOUNT ActualAccount = (HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal);
+ HACCOUNT ActualAccount = (HACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal);
if (ActualAccount != nullptr) {
STARTUPINFOW si = { 0 };
si.cb = sizeof(si);
-
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile, "ContactApplication:ActualAccountSO-read wait\n");
- #endif
+
+#ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "ContactApplication:ActualAccountSO-read wait\n");
+#endif
if (WAIT_OBJECT_0 == WaitToReadFcn(ActualAccount->AccountAccessSO)) {
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile, "ContactApplication:ualAccountSO-read enter\n");
- #endif
+#ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "ContactApplication:ualAccountSO-read enter\n");
+#endif
if (ActualAccount->NewMailN.App != nullptr) {
WCHAR *Command;
if (ActualAccount->NewMailN.AppParam != nullptr)
- Command = new WCHAR[mir_wstrlen(ActualAccount->NewMailN.App)+mir_wstrlen(ActualAccount->NewMailN.AppParam)+6];
+ Command = new WCHAR[mir_wstrlen(ActualAccount->NewMailN.App) + mir_wstrlen(ActualAccount->NewMailN.AppParam) + 6];
else
- Command = new WCHAR[mir_wstrlen(ActualAccount->NewMailN.App)+6];
-
+ Command = new WCHAR[mir_wstrlen(ActualAccount->NewMailN.App) + 6];
+
if (Command != nullptr) {
mir_wstrcpy(Command, L"\"");
mir_wstrcat(Command, ActualAccount->NewMailN.App);
@@ -103,15 +103,15 @@ static INT_PTR ContactApplication(WPARAM wParam, LPARAM) }
}
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile, "ContactApplication:ActualAccountSO-read done\n");
- #endif
+#ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "ContactApplication:ActualAccountSO-read done\n");
+#endif
ReadDoneFcn(ActualAccount->AccountAccessSO);
}
- #ifdef DEBUG_SYNCHRO
+#ifdef DEBUG_SYNCHRO
else
DebugLog(SynchroFile, "ContactApplication:ActualAccountSO-read enter failed\n");
- #endif
+#endif
}
db_free(&dbv);
return 0;
@@ -133,18 +133,18 @@ static INT_PTR AccountMailCheck(WPARAM wParam, LPARAM lParam) return 0;
mir_cslock lck(PluginRegCS);
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile, "AccountCheck:ActualAccountSO-read wait\n");
- #endif
+#ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "AccountCheck:ActualAccountSO-read wait\n");
+#endif
if (WAIT_OBJECT_0 != SWMRGWaitToRead(ActualAccount->AccountAccessSO, 0)) {
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read wait failed\n");
- #endif
+#ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read wait failed\n");
+#endif
}
else {
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read enter\n");
- #endif
+#ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read enter\n");
+#endif
if ((ActualAccount->Flags & YAMN_ACC_ENA) && ActualAccount->Plugin->Fcn->SynchroFcnPtr) {
CheckParam ParamToPlugin = { YAMN_CHECKVERSION, ThreadRunningEV, ActualAccount, lParam ? YAMN_FORCECHECK : YAMN_NORMALCHECK, nullptr, nullptr };
@@ -166,14 +166,14 @@ static INT_PTR AccountMailCheck(WPARAM wParam, LPARAM lParam) static INT_PTR ContactMailCheck(WPARAM hContact, LPARAM)
{
char *szProto = GetContactProto(hContact);
- if ( mir_strcmp(szProto, YAMN_DBMODULE))
+ if (mir_strcmp(szProto, YAMN_DBMODULE))
return 0;
DBVARIANT dbv;
- if ( db_get(hContact, YAMN_DBMODULE, "Id", &dbv))
+ if (db_get_s(hContact, YAMN_DBMODULE, "Id", &dbv))
return 0;
- HACCOUNT ActualAccount = (HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal);
+ HACCOUNT ActualAccount = (HACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal);
if (ActualAccount != nullptr) {
//we use event to signal, that running thread has all needed stack parameters copied
HANDLE ThreadRunningEV;
@@ -183,27 +183,25 @@ static INT_PTR ContactMailCheck(WPARAM hContact, LPARAM) if (WAIT_OBJECT_0 == WaitForSingleObject(ExitEV, 0))
return 0;
mir_cslock lck(PluginRegCS);
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read wait\n");
- #endif
- if (WAIT_OBJECT_0 != WaitToReadFcn(ActualAccount->AccountAccessSO))
- {
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read wait failed\n");
- #endif
+#ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read wait\n");
+#endif
+ if (WAIT_OBJECT_0 != WaitToReadFcn(ActualAccount->AccountAccessSO)) {
+#ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read wait failed\n");
+#endif
}
- else
- {
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read enter\n");
- #endif
+ else {
+#ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read enter\n");
+#endif
if ((ActualAccount->Flags & YAMN_ACC_ENA) && (ActualAccount->StatusFlags & YAMN_ACC_FORCE)) //account cannot be forced to check
{
if (ActualAccount->Plugin->Fcn->ForceCheckFcnPtr == nullptr)
ReadDoneFcn(ActualAccount->AccountAccessSO);
DWORD tid;
- struct CheckParam ParamToPlugin = {YAMN_CHECKVERSION, ThreadRunningEV, ActualAccount, YAMN_FORCECHECK, (void *)nullptr, nullptr};
+ struct CheckParam ParamToPlugin = { YAMN_CHECKVERSION, ThreadRunningEV, ActualAccount, YAMN_FORCECHECK, (void *)nullptr, nullptr };
if (nullptr == CreateThread(nullptr, 0, (YAMN_STANDARDFCN)ActualAccount->Plugin->Fcn->ForceCheckFcnPtr, &ParamToPlugin, 0, &tid))
ReadDoneFcn(ActualAccount->AccountAccessSO);
else
@@ -220,22 +218,22 @@ static INT_PTR ContactMailCheck(WPARAM hContact, LPARAM) /*static*/ void ContactDoubleclicked(WPARAM wParam, LPARAM)
{
char *szProto = GetContactProto(wParam);
- if ( mir_strcmp(szProto, YAMN_DBMODULE))
+ if (mir_strcmp(szProto, YAMN_DBMODULE))
return;
DBVARIANT dbv;
- if ( db_get(wParam, YAMN_DBMODULE, "Id", &dbv))
+ if (db_get_s(wParam, YAMN_DBMODULE, "Id", &dbv))
return;
HACCOUNT ActualAccount = (HACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal);
if (ActualAccount != nullptr) {
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile, "Service_ContactDoubleclicked:ActualAccountSO-read wait\n");
- #endif
+#ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Service_ContactDoubleclicked:ActualAccountSO-read wait\n");
+#endif
if (WAIT_OBJECT_0 == WaitToReadFcn(ActualAccount->AccountAccessSO)) {
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile, "Service_ContactDoubleclicked:ActualAccountSO-read enter\n");
- #endif
+#ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Service_ContactDoubleclicked:ActualAccountSO-read enter\n");
+#endif
YAMN_MAILBROWSERPARAM Param = { nullptr, ActualAccount, ActualAccount->NewMailN.Flags, ActualAccount->NoNewMailN.Flags, nullptr };
Param.nnflags = Param.nnflags | YAMN_ACC_MSG; //show mails in account even no new mail in account
@@ -245,17 +243,17 @@ static INT_PTR ContactMailCheck(WPARAM hContact, LPARAM) Param.nflags = Param.nflags & ~YAMN_ACC_POP;
RunMailBrowserSvc((WPARAM)&Param, YAMN_MAILBROWSERVERSION);
-
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile, "Service_ContactDoubleclicked:ActualAccountSO-read done\n");
- #endif
+
+#ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Service_ContactDoubleclicked:ActualAccountSO-read done\n");
+#endif
ReadDoneFcn(ActualAccount->AccountAccessSO);
}
- #ifdef DEBUG_SYNCHRO
+#ifdef DEBUG_SYNCHRO
else
DebugLog(SynchroFile, "Service_ContactDoubleclicked:ActualAccountSO-read enter failed\n");
- #endif
-
+#endif
+
}
db_free(&dbv);
}
@@ -269,14 +267,14 @@ HBITMAP LoadBmpFromIcon(HICON hIcon) HBRUSH hBkgBrush = CreateSolidBrush(GetSysColor(COLOR_3DFACE));
- BITMAPINFOHEADER bih = {0};
+ BITMAPINFOHEADER bih = { 0 };
bih.biSize = sizeof(bih);
bih.biBitCount = 24;
bih.biPlanes = 1;
bih.biCompression = BI_RGB;
bih.biHeight = IconSizeY;
- bih.biWidth = IconSizeX;
-
+ bih.biWidth = IconSizeX;
+
RECT rc;
rc.top = rc.left = 0;
rc.right = bih.biWidth;
@@ -292,10 +290,10 @@ HBITMAP LoadBmpFromIcon(HICON hIcon) return hBmp;
}
-int AddTopToolbarIcon(WPARAM,LPARAM)
+int AddTopToolbarIcon(WPARAM, LPARAM)
{
- if ( db_get_b(NULL, YAMN_DBMODULE, YAMN_TTBFCHECK, 1)) {
- if ( ServiceExists(MS_TTB_REMOVEBUTTON) && hTTButton == nullptr) {
+ if (db_get_b(NULL, YAMN_DBMODULE, YAMN_TTBFCHECK, 1)) {
+ if (ServiceExists(MS_TTB_REMOVEBUTTON) && hTTButton == nullptr) {
TTBButton btn = {};
btn.pszService = MS_YAMN_FORCECHECK;
btn.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
@@ -433,7 +431,7 @@ void CreateServiceFunctions(void) void RefreshContact(void)
{
HACCOUNT Finder;
- for (Finder = POP3Plugin->FirstAccount;Finder != nullptr;Finder = Finder->Next) {
+ for (Finder = POP3Plugin->FirstAccount; Finder != nullptr; Finder = Finder->Next) {
if (Finder->hContact != NULL) {
if ((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT))
db_unset(Finder->hContact, "CList", "Hidden");
@@ -448,4 +446,6 @@ void RefreshContact(void) db_set_s(Finder->hContact, "Protocol", "p", YAMN_DBMODULE);
db_set_w(Finder->hContact, YAMN_DBMODULE, "Status", ID_STATUS_ONLINE);
db_set_s(Finder->hContact, "CList", "StatusMsg", Translate("No new mail message"));
-} } }
+ }
+ }
+}
diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp index b16bcd1c97..9269daf7ea 100644 --- a/plugins/wbOSD/src/events.cpp +++ b/plugins/wbOSD/src/events.cpp @@ -156,7 +156,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent) DBVARIANT dbv;
if (!db_get_ws(NULL, MODULENAME, "message_format", &dbv)) {
- mir_wstrcpy(buf, dbv.ptszVal);
+ mir_wstrcpy(buf, dbv.pwszVal);
db_free(&dbv);
}
diff --git a/plugins/wbOSD/src/options.cpp b/plugins/wbOSD/src/options.cpp index 4e2cb3f448..cea0f87793 100644 --- a/plugins/wbOSD/src/options.cpp +++ b/plugins/wbOSD/src/options.cpp @@ -128,7 +128,7 @@ void loadDBSettings(plgsettings *ps) DBVARIANT dbv;
if (!db_get_ws(NULL, MODULENAME, "message_format", &dbv)) {
- mir_wstrcpy(ps->msgformat, dbv.ptszVal);
+ mir_wstrcpy(ps->msgformat, dbv.pwszVal);
db_free(&dbv);
}
else mir_wstrcpy(ps->msgformat, DEFAULT_MESSAGEFORMAT);
@@ -150,7 +150,7 @@ void loadDBSettings(plgsettings *ps) ps->lf.lfPitchAndFamily = db_get_b(NULL, MODULENAME, "fntPitchAndFamily", DEFAULT_FNT_PITCHANDFAM);
if (!db_get_ws(NULL, MODULENAME, "fntFaceName", &dbv)) {
- mir_wstrcpy(ps->lf.lfFaceName, dbv.ptszVal);
+ mir_wstrcpy(ps->lf.lfFaceName, dbv.pwszVal);
db_free(&dbv);
}
else
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 81416b50c4..22c6198556 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -70,8 +70,8 @@ void GaduProto::disconnect() szMsg = mir_utf8encodeW(modemsg.online);
gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 6, 1, "modemsg_mutex", 1);
if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_ONLINE, "Default"), &dbv, DBVT_WCHAR)) {
- if (dbv.ptszVal && *(dbv.ptszVal))
- szMsg = mir_utf8encodeW(dbv.ptszVal);
+ if (dbv.pwszVal && *(dbv.pwszVal))
+ szMsg = mir_utf8encodeW(dbv.pwszVal);
db_free(&dbv);
}
break;
@@ -81,8 +81,8 @@ void GaduProto::disconnect() szMsg = mir_utf8encodeW(modemsg.away);
gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 7, 1, "modemsg_mutex", 1);
if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_AWAY, "Default"), &dbv, DBVT_WCHAR)) {
- if (dbv.ptszVal && *(dbv.ptszVal))
- szMsg = mir_utf8encodeW(dbv.ptszVal);
+ if (dbv.pwszVal && *(dbv.pwszVal))
+ szMsg = mir_utf8encodeW(dbv.pwszVal);
db_free(&dbv);
}
break;
@@ -92,8 +92,8 @@ void GaduProto::disconnect() szMsg = mir_utf8encodeW(modemsg.dnd);
gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 8, 1, "modemsg_mutex", 1);
if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_DND, "Default"), &dbv, DBVT_WCHAR)) {
- if (dbv.ptszVal && *(dbv.ptszVal))
- szMsg = mir_utf8encodeW(dbv.ptszVal);
+ if (dbv.pwszVal && *(dbv.pwszVal))
+ szMsg = mir_utf8encodeW(dbv.pwszVal);
db_free(&dbv);
}
break;
@@ -103,8 +103,8 @@ void GaduProto::disconnect() szMsg = mir_utf8encodeW(modemsg.freechat);
gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 9, 1, "modemsg_mutex", 1);
if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_FREECHAT, "Default"), &dbv, DBVT_WCHAR)) {
- if (dbv.ptszVal && *(dbv.ptszVal))
- szMsg = mir_utf8encodeW(dbv.ptszVal);
+ if (dbv.pwszVal && *(dbv.pwszVal))
+ szMsg = mir_utf8encodeW(dbv.pwszVal);
db_free(&dbv);
}
break;
@@ -114,8 +114,8 @@ void GaduProto::disconnect() szMsg = mir_utf8encodeW(modemsg.invisible);
gg_LeaveCriticalSection(&modemsg_mutex, "disconnect", 10, 1, "modemsg_mutex", 1);
if (!szMsg && !db_get_s(NULL, "SRAway", gg_status2db(ID_STATUS_INVISIBLE, "Default"), &dbv, DBVT_WCHAR)) {
- if (dbv.ptszVal && *(dbv.ptszVal))
- szMsg = mir_utf8encodeW(dbv.ptszVal);
+ if (dbv.pwszVal && *(dbv.pwszVal))
+ szMsg = mir_utf8encodeW(dbv.pwszVal);
db_free(&dbv);
}
break;
@@ -881,7 +881,7 @@ retry: gce.ptszText = messageT;
wchar_t* nickT;
if (!getWString(GG_KEY_NICK, &dbv)) {
- nickT = mir_wstrdup(dbv.ptszVal);
+ nickT = mir_wstrdup(dbv.pwszVal);
db_free(&dbv);
}
else
@@ -1318,12 +1318,12 @@ int GaduProto::dbsettingchanged(WPARAM hContact, LPARAM lParam) {
// Most important... check redundancy (fucking cascading)
static int cascade = 0;
- if (!cascade && dbv.ptszVal)
+ if (!cascade && dbv.pwszVal)
{
debugLogA("dbsettingchanged(): Conference %s was renamed.", dbv.pszVal);
// Mark cascading
/* FIXME */ cascade = 1;
- Chat_ChangeSessionName(m_szModuleName, dbv.ptszVal, ptszVal);
+ Chat_ChangeSessionName(m_szModuleName, dbv.pwszVal, ptszVal);
/* FIXME */ cascade = 0;
}
db_free(&dbv);
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp index 64cbbea445..2c622e2551 100644 --- a/protocols/Gadu-Gadu/src/dialogs.cpp +++ b/protocols/Gadu-Gadu/src/dialogs.cpp @@ -127,8 +127,8 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule mir_snwprintf(str, L"%S", dbv.pszVal); break; case DBVT_WCHAR: - unspecified = (special == SVS_ZEROISUNSPEC && dbv.ptszVal[0] == '\0'); - ptstr = dbv.ptszVal; + unspecified = (special == SVS_ZEROISUNSPEC && dbv.pwszVal[0] == '\0'); + ptstr = dbv.pwszVal; break; case DBVT_UTF8: unspecified = (special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0'); diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 46f32e1a94..e839edf429 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -598,8 +598,8 @@ void __cdecl GaduProto::getawaymsgthread(void *arg) debugLogA("getawaymsgthread(): started");
gg_sleep(100, FALSE, "getawaymsgthread", 106, 1);
if (!db_get_s(hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_WCHAR)) {
- ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
- debugLogW(L"getawaymsgthread(): Reading away msg <%s>.", dbv.ptszVal);
+ ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.pwszVal);
+ debugLogW(L"getawaymsgthread(): Reading away msg <%s>.", dbv.pwszVal);
db_free(&dbv);
}
else {
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 44e061dc72..609bc68b9f 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -135,7 +135,7 @@ int GaduProto::gc_event(WPARAM, LPARAM lParam) MCONTACT hNext = db_find_next(hContact);
DBVARIANT dbv;
if (!getWString(hContact, "ChatRoomID", &dbv)) {
- if (dbv.ptszVal && !mir_wstrcmp(gch->ptszID, dbv.ptszVal))
+ if (dbv.pwszVal && !mir_wstrcmp(gch->ptszID, dbv.pwszVal))
db_delete_contact(hContact);
db_free(&dbv);
}
@@ -155,7 +155,7 @@ int GaduProto::gc_event(WPARAM, LPARAM lParam) gce.ptszText = gch->ptszText;
wchar_t* nickT;
if (!getWString(GG_KEY_NICK, &dbv)) {
- nickT = mir_wstrdup(dbv.ptszVal);
+ nickT = mir_wstrdup(dbv.pwszVal);
db_free(&dbv);
}
else
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index e461b82906..80f4bc9a28 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -33,7 +33,7 @@ char *gg_makecontacts(GaduProto *gg, int cr) DBVARIANT dbv;
if (!gg->getWString(hContact, GG_KEY_PD_FIRSTNAME, &dbv))
{
- char* pszValA = mir_u2a(dbv.ptszVal);
+ char* pszValA = mir_u2a(dbv.pwszVal);
string_append(s, dbv.pszVal);
mir_free(pszValA);
db_free(&dbv);
@@ -42,7 +42,7 @@ char *gg_makecontacts(GaduProto *gg, int cr) // Readup LastName
if (!gg->getWString(hContact, GG_KEY_PD_LASTNAME, &dbv))
{
- char* pszValA = mir_u2a(dbv.ptszVal);
+ char* pszValA = mir_u2a(dbv.pwszVal);
string_append(s, dbv.pszVal);
mir_free(pszValA);
db_free(&dbv);
@@ -52,11 +52,11 @@ char *gg_makecontacts(GaduProto *gg, int cr) // Readup Nick
if (!db_get_ws(hContact, "CList", "MyHandle", &dbv) || !gg->getWString(hContact, GG_KEY_NICK, &dbv))
{
- char* dbvA = mir_u2a(dbv.ptszVal);
+ char* dbvA = mir_u2a(dbv.pwszVal);
DBVARIANT dbv2;
if (!gg->getWString(hContact, GG_KEY_PD_NICKNAME, &dbv2))
{
- char* pszValA = mir_u2a(dbv2.ptszVal);
+ char* pszValA = mir_u2a(dbv2.pwszVal);
string_append(s, pszValA);
mir_free(pszValA);
db_free(&dbv2);
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index f58bcc2e50..37b148c012 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -192,9 +192,9 @@ INT_PTR GaduProto::getavatarinfo(WPARAM wParam, LPARAM lParam) //directly check if contact has protected user avatar set by AVS, and if yes return it as protocol avatar
DBVARIANT dbv;
if (!db_get_ws(pai->hContact, "ContactPhoto", "Backup", &dbv)) {
- if ((mir_wstrlen(dbv.ptszVal)>0) && db_get_b(pai->hContact, "ContactPhoto", "Locked", 0)) {
+ if ((mir_wstrlen(dbv.pwszVal)>0) && db_get_b(pai->hContact, "ContactPhoto", "Locked", 0)) {
debugLogA("getavatarinfo(): Incoming request for avatar information. Contact has assigned Locked ContactPhoto. return GAIR_SUCCESS");
- wcscpy_s(pai->filename, _countof(pai->filename), dbv.ptszVal);
+ wcscpy_s(pai->filename, _countof(pai->filename), dbv.pwszVal);
pai->format = ProtoGetAvatarFormat(pai->filename);
db_free(&dbv);
return GAIR_SUCCESS;
diff --git a/protocols/ICQCorp/src/options.cpp b/protocols/ICQCorp/src/options.cpp index 380daf9b49..2b0e9f1b2c 100644 --- a/protocols/ICQCorp/src/options.cpp +++ b/protocols/ICQCorp/src/options.cpp @@ -30,11 +30,11 @@ static INT_PTR CALLBACK icqOptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP case WM_INITDIALOG:
TranslateDialogDefault(hWnd);
SetDlgItemInt(hWnd, IDC_OPT_UIN, db_get_dw(NULL, protoName, "UIN", 0), FALSE);
- if (!db_get(NULL, protoName, "Password", &dbv)) {
+ if (!db_get_s(NULL, protoName, "Password", &dbv)) {
SetDlgItemTextA(hWnd, IDC_OPT_PASSWORD, dbv.pszVal);
db_free(&dbv);
}
- if (!db_get(NULL, protoName, "Server", &dbv)) {
+ if (!db_get_s(NULL, protoName, "Server", &dbv)) {
SetDlgItemTextA(hWnd, IDC_OPT_SERVER, dbv.pszVal);
db_free(&dbv);
}
diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp index 7faa6c832e..6fa78b0e1a 100644 --- a/protocols/ICQCorp/src/protocol.cpp +++ b/protocols/ICQCorp/src/protocol.cpp @@ -195,7 +195,7 @@ bool ICQ::logon(unsigned short logonStatus) DBVARIANT dbv;
char str[128];
- if (!db_get(NULL, protoName, "Server", &dbv)) {
+ if (!db_get_s(NULL, protoName, "Server", &dbv)) {
lstrcpyA(str, dbv.pszVal);
db_free(&dbv);
}
@@ -219,12 +219,11 @@ bool ICQ::logon(unsigned short logonStatus) updateContactList();
dwUIN = db_get_dw(NULL, protoName, "UIN", 0);
- if (!db_get(NULL, protoName, "Password", &dbv)) {
+ if (!db_get_s(NULL, protoName, "Password", &dbv)) {
lstrcpyA(str, dbv.pszVal);
db_free(&dbv);
}
-
timeStampLastMessage = 0;
sequenceVal = 1;
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index 4c6b695325..4cffc5dd14 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -124,7 +124,7 @@ MCONTACT CIrcProto::CList_SetOffline(CONTACT *user) if (!getWString(hContact, "Default", &dbv)) {
setString(hContact, "User", "");
setString(hContact, "Host", "");
- setWString(hContact, "Nick", dbv.ptszVal);
+ setWString(hContact, "Nick", dbv.pwszVal);
setWord(hContact, "Status", ID_STATUS_OFFLINE);
db_free(&dbv);
return hContact;
@@ -149,7 +149,7 @@ bool CIrcProto::CList_SetAllOffline(BYTE ChatsToo) setWord(hContact, "Status", ID_STATUS_OFFLINE);
}
else if (!getWString(hContact, "Default", &dbv)) {
- setWString(hContact, "Nick", dbv.ptszVal);
+ setWString(hContact, "Nick", dbv.pwszVal);
setWord(hContact, "Status", ID_STATUS_OFFLINE);
db_free(&dbv);
}
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 464ed5bea1..2d84403b90 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -156,7 +156,7 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) if (!bAdvanced) {
db_free(&dbv);
if (!ppro->getWString(hContact, "Nick", &dbv)) {
- ppro->m_namesToUserhost += CMStringW(dbv.ptszVal) + L" ";
+ ppro->m_namesToUserhost += CMStringW(dbv.pwszVal) + L" ";
db_free(&dbv);
}
}
@@ -167,9 +167,9 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) wchar_t* DBNick = nullptr;
wchar_t* DBWildcard = nullptr;
if (!ppro->getWString(hContact, "Nick", &dbv))
- DBNick = dbv.ptszVal;
+ DBNick = dbv.pwszVal;
if (!ppro->getWString(hContact, "UWildcard", &dbv2))
- DBWildcard = dbv2.ptszVal;
+ DBWildcard = dbv2.pwszVal;
if (DBNick && (!DBWildcard || !WCCmp(CharLower(DBWildcard), CharLower(DBNick))))
ppro->m_namesToWho += CMStringW(DBNick) + L" ";
@@ -1366,7 +1366,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage *pmsg) int k = 0;
while (!command.IsEmpty()) {
- command = GetWord(dbv.ptszVal, k);
+ command = GetWord(dbv.pwszVal, k);
k++;
if (!command.IsEmpty()) {
CMStringW S = command.Mid(1);
@@ -1378,7 +1378,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage *pmsg) }
if (!command.IsEmpty()) {
- save += GetWordAddress(dbv.ptszVal, k);
+ save += GetWordAddress(dbv.pwszVal, k);
switch (command[0]) {
case 'M':
Chat_Control(m_szModuleName, sID, WINDOW_HIDDEN);
@@ -1743,17 +1743,17 @@ bool CIrcProto::OnIrc_WHOIS_NO_USER(const CIrcMessage *pmsg) DBVARIANT dbv;
if (!getWString(hContact, "Default", &dbv)) {
- setWString(hContact, "Nick", dbv.ptszVal);
+ setWString(hContact, "Nick", dbv.pwszVal);
DBVARIANT dbv2;
if (getByte(hContact, "AdvancedMode", 0) == 0)
- DoUserhostWithReason(1, ((CMStringW)L"S" + dbv.ptszVal), true, dbv.ptszVal);
+ DoUserhostWithReason(1, ((CMStringW)L"S" + dbv.pwszVal), true, dbv.pwszVal);
else {
if (!getWString(hContact, "UWildcard", &dbv2)) {
- DoUserhostWithReason(2, ((CMStringW)L"S" + dbv2.ptszVal), true, dbv2.ptszVal);
+ DoUserhostWithReason(2, ((CMStringW)L"S" + dbv2.pwszVal), true, dbv2.pwszVal);
db_free(&dbv2);
}
- else DoUserhostWithReason(2, ((CMStringW)L"S" + dbv.ptszVal), true, dbv.ptszVal);
+ else DoUserhostWithReason(2, ((CMStringW)L"S" + dbv.pwszVal), true, dbv.pwszVal);
}
setString(hContact, "User", "");
setString(hContact, "Host", "");
@@ -1811,7 +1811,7 @@ bool CIrcProto::OnIrc_JOINERROR(const CIrcMessage *pmsg) int i = 0;
while (!command.IsEmpty()) {
- command = GetWord(dbv.ptszVal, i);
+ command = GetWord(dbv.pwszVal, i);
i++;
if (!command.IsEmpty() && pmsg->parameters[0] == command.Mid(1))
@@ -2390,8 +2390,8 @@ int CIrcProto::DoPerform(const char* event) DBVARIANT dbv;
if (!getWString(sSetting, &dbv)) {
- if (!my_strstri(dbv.ptszVal, L"/away"))
- PostIrcMessageWnd(nullptr, NULL, dbv.ptszVal);
+ if (!my_strstri(dbv.pwszVal, L"/away"))
+ PostIrcMessageWnd(nullptr, NULL, dbv.pwszVal);
else
mir_forkthread(AwayWarningThread);
db_free(&dbv);
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp index 169dbc4153..f7cf3b6f84 100644 --- a/protocols/IRCG/src/input.cpp +++ b/protocols/IRCG/src/input.cpp @@ -51,7 +51,7 @@ void CIrcProto::FormatMsg(CMStringW& text) if (sNick4Perform == L"") {
DBVARIANT dbv;
if (!getWString("PNick", &dbv)) {
- sNick4Perform = dbv.ptszVal;
+ sNick4Perform = dbv.pwszVal;
db_free(&dbv);
}
}
@@ -549,8 +549,8 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo DBVARIANT dbv1;
if (!getWString(hContact, "UWildcard", &dbv1)) {
CMStringW S = L"S";
- S += dbv1.ptszVal;
- DoUserhostWithReason(2, S.c_str(), true, dbv1.ptszVal);
+ S += dbv1.pwszVal;
+ DoUserhostWithReason(2, S.c_str(), true, dbv1.pwszVal);
db_free(&dbv1);
}
else {
@@ -624,8 +624,8 @@ BOOL CIrcProto::DoHardcodedCommand(CMStringW text, wchar_t *window, MCONTACT hCo DBVARIANT dbv1;
CMStringW S = L"S";
if (!getWString(ccNew, "UWildcard", &dbv1)) {
- S += dbv1.ptszVal;
- DoUserhostWithReason(2, S.c_str(), true, dbv1.ptszVal);
+ S += dbv1.pwszVal;
+ DoUserhostWithReason(2, S.c_str(), true, dbv1.pwszVal);
db_free(&dbv1);
}
else {
@@ -804,7 +804,7 @@ bool CIrcProto::PostIrcMessageWnd(wchar_t *window, MCONTACT hContact, const wcha return 0;
if (hContact && !getWString(hContact, "Nick", &dbv)) {
- mir_wstrncpy(windowname, dbv.ptszVal, 255);
+ mir_wstrncpy(windowname, dbv.pwszVal, 255);
db_free(&dbv);
}
else if (window)
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index 04b56f2c6a..96426b287e 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -527,7 +527,7 @@ CDccSession* CIrcProto::FindDCCRecvByPortAndName(int iPort, const wchar_t* szNam for (auto &p : m_dcc_xfers) { DBVARIANT dbv; if (!getWString(p->di->hContact, "Nick", &dbv)) { - if (p->di->iType == DCC_SEND && !p->di->bSender && !mir_wstrcmpi(szName, dbv.ptszVal) && iPort == p->di->iPort) { + if (p->di->iType == DCC_SEND && !p->di->bSender && !mir_wstrcmpi(szName, dbv.pwszVal) && iPort == p->di->iPort) { db_free(&dbv); return p; } diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index f4c42f4e80..096ed5b1c8 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -250,7 +250,7 @@ void CIrcProto::OnModulesLoaded() if (!getWString(*it, &dbv)) {
db_unset(NULL, m_szModuleName, *it);
it->MakeUpper();
- setWString(*it, dbv.ptszVal);
+ setWString(*it, dbv.pwszVal);
db_free(&dbv);
}
}
@@ -302,8 +302,8 @@ MCONTACT CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr) }
else {
if (!getWString(hContact, "UWildcard", &dbv1)) {
- S += dbv1.ptszVal;
- DoUserhostWithReason(2, S, true, dbv1.ptszVal);
+ S += dbv1.pwszVal;
+ DoUserhostWithReason(2, S, true, dbv1.pwszVal);
db_free(&dbv1);
}
else {
@@ -556,7 +556,7 @@ HANDLE CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t** ppszFile }
dci->hContact = hContact;
- dci->sContactName = dbv.ptszVal;
+ dci->sContactName = dbv.pwszVal;
dci->iType = DCC_SEND;
dci->bReverse = m_DCCPassive ? true : false;
dci->bSender = true;
@@ -772,7 +772,7 @@ HANDLE CIrcProto::GetAwayMsg(MCONTACT hContact) return nullptr;
}
CMStringW S = L"WHOIS ";
- S += dbv.ptszVal;
+ S += dbv.pwszVal;
if (IsConnected())
SendIrcMessage(S.c_str(), false);
db_free(&dbv);
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index a1ae6248a0..d1e155fd9d 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -62,11 +62,11 @@ void CIrcProto::ReadSettings(TDbSetting* sets, int count) case DBVT_WCHAR:
if (!getWString(p->name, &dbv)) {
if (p->size != -1) {
- size_t len = min(p->size - 1, mir_wstrlen(dbv.ptszVal));
+ size_t len = min(p->size - 1, mir_wstrlen(dbv.pwszVal));
memcpy(ptr, dbv.pszVal, len*sizeof(wchar_t));
*(wchar_t*)&ptr[len*sizeof(wchar_t)] = 0;
}
- else *(wchar_t**)ptr = mir_wstrdup(dbv.ptszVal);
+ else *(wchar_t**)ptr = mir_wstrdup(dbv.pwszVal);
db_free(&dbv);
}
else {
@@ -1177,7 +1177,7 @@ void COtherPrefsDlg::addPerformComboValue(int idx, const char* szValueName) PERFORM_INFO* pPref;
DBVARIANT dbv;
if (!m_proto->getWString(sSetting.c_str(), &dbv)) {
- pPref = new PERFORM_INFO(sSetting.c_str(), dbv.ptszVal);
+ pPref = new PERFORM_INFO(sSetting.c_str(), dbv.pwszVal);
db_free(&dbv);
}
else pPref = new PERFORM_INFO(sSetting.c_str(), L"");
@@ -1363,9 +1363,9 @@ void CIrcProto::InitIgnore(void) if (getWString(settingName, &dbv))
break;
- CMStringW mask = GetWord(dbv.ptszVal, 0);
- CMStringW flags = GetWord(dbv.ptszVal, 1);
- CMStringW network = GetWord(dbv.ptszVal, 2);
+ CMStringW mask = GetWord(dbv.pwszVal, 0);
+ CMStringW flags = GetWord(dbv.pwszVal, 1);
+ CMStringW network = GetWord(dbv.pwszVal, 2);
m_ignoreItems.insert(new CIrcIgnoreItem(mask.c_str(), flags.c_str(), network.c_str()));
db_free(&dbv);
}
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 01824a8e25..d1d79044e8 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -183,12 +183,12 @@ void CIrcProto::OnContactDeleted(MCONTACT hContact) if (type != 0) {
CMStringW S;
if (type == GCW_CHATROOM)
- S = MakeWndID(dbv.ptszVal);
+ S = MakeWndID(dbv.pwszVal);
if (type == GCW_SERVER)
S = SERVERWINDOW;
int i = Chat_Terminate(m_szModuleName, S);
if (i && type == GCW_CHATROOM)
- PostIrcMessage(L"/PART %s %s", dbv.ptszVal, m_userInfo);
+ PostIrcMessage(L"/PART %s %s", dbv.pwszVal, m_userInfo);
}
else {
BYTE bDCC = getByte(hContact, "DCC", 0);
@@ -211,7 +211,7 @@ INT_PTR __cdecl CIrcProto::OnJoinChat(WPARAM wp, LPARAM) DBVARIANT dbv;
if (!getWString((MCONTACT)wp, "Nick", &dbv)) {
if (getByte((MCONTACT)wp, "ChatRoom", 0) == GCW_CHATROOM)
- PostIrcMessage(L"/JOIN %s", dbv.ptszVal);
+ PostIrcMessage(L"/JOIN %s", dbv.pwszVal);
db_free(&dbv);
}
return 0;
@@ -225,8 +225,8 @@ INT_PTR __cdecl CIrcProto::OnLeaveChat(WPARAM wp, LPARAM) DBVARIANT dbv;
if (!getWString((MCONTACT)wp, "Nick", &dbv)) {
if (getByte((MCONTACT)wp, "ChatRoom", 0) == GCW_CHATROOM) {
- PostIrcMessage(L"/PART %s %s", dbv.ptszVal, m_userInfo);
- Chat_Terminate(m_szModuleName, MakeWndID(dbv.ptszVal));
+ PostIrcMessage(L"/PART %s %s", dbv.pwszVal, m_userInfo);
+ Chat_Terminate(m_szModuleName, MakeWndID(dbv.pwszVal));
}
db_free(&dbv);
}
@@ -241,7 +241,7 @@ INT_PTR __cdecl CIrcProto::OnMenuChanSettings(WPARAM wp, LPARAM) MCONTACT hContact = (MCONTACT)wp;
DBVARIANT dbv;
if (!getWString(hContact, "Nick", &dbv)) {
- PostIrcMessageWnd(dbv.ptszVal, NULL, L"/CHANNELMANAGER");
+ PostIrcMessageWnd(dbv.pwszVal, NULL, L"/CHANNELMANAGER");
db_free(&dbv);
}
return 0;
@@ -255,7 +255,7 @@ INT_PTR __cdecl CIrcProto::OnMenuWhois(WPARAM wp, LPARAM) DBVARIANT dbv;
if (!getWString((MCONTACT)wp, "Nick", &dbv)) {
- PostIrcMessage(L"/WHOIS %s %s", dbv.ptszVal, dbv.ptszVal);
+ PostIrcMessage(L"/WHOIS %s %s", dbv.pwszVal, dbv.pwszVal);
db_free(&dbv);
}
return 0;
@@ -540,7 +540,7 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam) {
DBVARIANT dbv;
if (!getWString("Nick", &dbv)) {
- PostIrcMessage(L"/nickserv SENDPASS %s", dbv.ptszVal);
+ PostIrcMessage(L"/nickserv SENDPASS %s", dbv.pwszVal);
db_free(&dbv);
}
}
@@ -917,7 +917,7 @@ int __cdecl CIrcProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) DBVARIANT dbv;
if (!getWString(hContact, "Nick", &dbv)) {
if (getByte("MirVerAutoRequest", 1))
- PostIrcMessage(L"/PRIVMSG %s \001VERSION\001", dbv.ptszVal);
+ PostIrcMessage(L"/PRIVMSG %s \001VERSION\001", dbv.pwszVal);
db_free(&dbv);
}
}
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp index 311e5bf494..740a331842 100644 --- a/protocols/IRCG/src/tools.cpp +++ b/protocols/IRCG/src/tools.cpp @@ -42,7 +42,7 @@ void CIrcProto::AddToJTemp(wchar_t op, CMStringW& sCommand) DBVARIANT dbv;
if (!getWString("JTemp", &dbv)) {
- res = CMStringW(dbv.ptszVal) + L" " + res;
+ res = CMStringW(dbv.pwszVal) + L" " + res;
db_free(&dbv);
}
diff --git a/protocols/IRCG/src/userinfo.cpp b/protocols/IRCG/src/userinfo.cpp index fc50e5ae56..1d93cab326 100644 --- a/protocols/IRCG/src/userinfo.cpp +++ b/protocols/IRCG/src/userinfo.cpp @@ -65,25 +65,25 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM if (!bAdvanced) {
SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateW(STR_BASIC));
if (!p->ppro->getWString(p->hContact, "Default", &dbv)) {
- SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.ptszVal);
+ SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.pwszVal);
db_free(&dbv);
}
}
else {
SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateW(STR_ADVANCED));
if (!p->ppro->getWString(p->hContact, "UWildcard", &dbv)) {
- SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.ptszVal);
+ SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.pwszVal);
db_free(&dbv);
}
}
if (!p->ppro->getWString(p->hContact, "UUser", &dbv)) {
- SetDlgItemText(m_hwnd, IDC_USER, dbv.ptszVal);
+ SetDlgItemText(m_hwnd, IDC_USER, dbv.pwszVal);
db_free(&dbv);
}
if (!p->ppro->getWString(p->hContact, "UHost", &dbv)) {
- SetDlgItemText(m_hwnd, IDC_HOST, dbv.ptszVal);
+ SetDlgItemText(m_hwnd, IDC_HOST, dbv.pwszVal);
db_free(&dbv);
}
ProtoBroadcastAck(p->ppro->m_szModuleName, p->hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1, 0);
@@ -115,9 +115,9 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM if (!p->ppro->getWString(p->hContact, "Default", &dbv)) {
CMStringW S = STR_ERROR;
S += L" (";
- S += dbv.ptszVal;
+ S += dbv.pwszVal;
S += L")";
- if ((mir_wstrlen(temp) < 4 && mir_wstrlen(temp)) || !WCCmp(CharLower(temp), CharLower(dbv.ptszVal))) {
+ if ((mir_wstrlen(temp) < 4 && mir_wstrlen(temp)) || !WCCmp(CharLower(temp), CharLower(dbv.pwszVal))) {
MessageBox(nullptr, TranslateW(S.c_str()), TranslateT("IRC error"), MB_OK | MB_ICONERROR);
db_free(&dbv);
return FALSE;
@@ -166,7 +166,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM DBVARIANT dbv;
if (!p->ppro->getWString(p->hContact, "Default", &dbv)) {
- SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.ptszVal);
+ SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.pwszVal);
db_free(&dbv);
}
EnableWindow(GetDlgItem(m_hwnd, IDC_WILDCARD), FALSE);
@@ -176,7 +176,7 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM DBVARIANT dbv;
SetDlgItemText(m_hwnd, IDC_DEFAULT, TranslateW(STR_ADVANCED));
if (!p->ppro->getWString(p->hContact, "UWildcard", &dbv)) {
- SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.ptszVal);
+ SetDlgItemText(m_hwnd, IDC_WILDCARD, dbv.pwszVal);
db_free(&dbv);
}
EnableWindow(GetDlgItem(m_hwnd, IDC_WILDCARD), true);
@@ -201,7 +201,7 @@ int __cdecl CIrcProto::OnInitUserInfo(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
if (!getWString(hContact, "Default", &dbv)) {
- if (IsChannel(dbv.ptszVal)) {
+ if (IsChannel(dbv.pwszVal)) {
db_free(&dbv);
return 0;
}
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp index b921af9029..728c451996 100644 --- a/protocols/IRCG/src/windows.cpp +++ b/protocols/IRCG/src/windows.cpp @@ -215,8 +215,8 @@ bool CNickDlg::OnInitDialog() DBVARIANT dbv;
if (!m_proto->getWString("RecentNicks", &dbv)) {
for (int i = 0; i < 10; i++)
- if (!GetWord(dbv.ptszVal, i).IsEmpty())
- SendDlgItemMessage(m_hwnd, IDC_ENICK, CB_ADDSTRING, 0, (LPARAM)GetWord(dbv.ptszVal, i).c_str());
+ if (!GetWord(dbv.pwszVal, i).IsEmpty())
+ SendDlgItemMessage(m_hwnd, IDC_ENICK, CB_ADDSTRING, 0, (LPARAM)GetWord(dbv.pwszVal, i).c_str());
db_free(&dbv);
}
@@ -239,7 +239,7 @@ void CNickDlg::OnOk(CCtrlButton*) DBVARIANT dbv;
if (!m_proto->getWString("RecentNicks", &dbv)) {
for (int i = 0; i < 10; i++) {
- CMStringW s = GetWord(dbv.ptszVal, i);
+ CMStringW s = GetWord(dbv.pwszVal, i);
if (!s.IsEmpty() && s != szTemp)
S += L" " + s;
}
@@ -509,8 +509,8 @@ bool CJoinDlg::OnInitDialog() DBVARIANT dbv;
if (!m_proto->getWString("RecentChannels", &dbv)) {
for (int i = 0; i < 20; i++) {
- if (!GetWord(dbv.ptszVal, i).IsEmpty()) {
- CMStringW S = GetWord(dbv.ptszVal, i);
+ if (!GetWord(dbv.pwszVal, i).IsEmpty()) {
+ CMStringW S = GetWord(dbv.pwszVal, i);
S.Replace(L"%newl", L" ");
SendDlgItemMessage(m_hwnd, IDC_ENICK, CB_ADDSTRING, 0, (LPARAM)S.c_str());
}
@@ -542,7 +542,7 @@ void CJoinDlg::OnOk(CCtrlButton*) DBVARIANT dbv;
if (!m_proto->getWString("RecentChannels", &dbv)) {
for (int i = 0; i < 20; i++) {
- CMStringW W = GetWord(dbv.ptszVal, i);
+ CMStringW W = GetWord(dbv.pwszVal, i);
if (!W.IsEmpty() && W != SL)
S += L" " + W;
}
@@ -1292,7 +1292,7 @@ void CManagerDlg::InitManager(int mode, const wchar_t* window) DBVARIANT dbv;
if (!m_proto->getWString(p, &dbv)) {
for (int i = 0; i < 5; i++) {
- CMStringW S = GetWord(dbv.ptszVal, i);
+ CMStringW S = GetWord(dbv.pwszVal, i);
if (!S.IsEmpty()) {
/* FIXME: What the hell does it mean!? GCC won't compile this on UNICODE */
#if !defined(__GNUC__) || !defined(UNICODE)
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index aabdf34ac5..eb747258d0 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -61,7 +61,7 @@ wchar_t* CIcqProto::GetOwnAvatarFileName() return nullptr;
wchar_t tmp[MAX_PATH * 2];
- PathToAbsoluteW(dbvFile.ptszVal, tmp);
+ PathToAbsoluteW(dbvFile.pwszVal, tmp);
db_free(&dbvFile);
return null_strdup(tmp);
diff --git a/protocols/IcqOscarJ/src/icq_db.cpp b/protocols/IcqOscarJ/src/icq_db.cpp index 5f6a58d951..4026cb3acf 100644 --- a/protocols/IcqOscarJ/src/icq_db.cpp +++ b/protocols/IcqOscarJ/src/icq_db.cpp @@ -170,7 +170,7 @@ void CIcqProto::setStatusMsgVar(MCONTACT hContact, char* szStatusMsg, bool isAns char *oldStatusMsg = nullptr;
DBVARIANT dbv;
if (!db_get_ws(hContact, "CList", "StatusMsg", &dbv)) {
- oldStatusMsg = make_utf8_string(dbv.ptszVal);
+ oldStatusMsg = make_utf8_string(dbv.pwszVal);
db_free(&dbv);
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index c75b40b146..e29c547cdf 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -906,8 +906,8 @@ int CJabberProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam) WindowList_Remove(hDialogsList, event->hwndWindow);
DBVARIANT dbv;
- BOOL bSupportTyping = FALSE;
- if (!db_get(event->hContact, "SRMsg", "SupportTyping", &dbv)) {
+ bool bSupportTyping = false;
+ if (!db_get_b(event->hContact, "SRMsg", "SupportTyping")) {
bSupportTyping = dbv.bVal == 1;
db_free(&dbv);
}
@@ -915,6 +915,7 @@ int CJabberProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam) bSupportTyping = dbv.bVal == 1;
db_free(&dbv);
}
+
if (!bSupportTyping || !m_bJabberOnline)
return 0;
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index d6ca2c6574..da212ffd72 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -1141,7 +1141,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w dbv.type = DBVT_BLOB;
dbv.pbVal = (PBYTE)&dwBlogStatusID;
dbv.cpbVal = sizeof(DWORDLONG);
- db_get(dat->hContact, dat->ppro->m_szModuleName, DBSETTING_BLOGSTATUSID, &dbv);
+ db_set(dat->hContact, dat->ppro->m_szModuleName, DBSETTING_BLOGSTATUSID, &dbv);
}
else {
dwFlags = MRIM_BLOG_STATUS_UPDATE;
diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp index 4278ebc8c0..7405e4a4b3 100644 --- a/protocols/MSN/src/msn_chat.cpp +++ b/protocols/MSN/src/msn_chat.cpp @@ -481,7 +481,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) GCEVENT gce = { m_szModuleName, gch->ptszID, GC_EVENT_MESSAGE };
gce.dwFlags = GCEF_ADDTOLOG;
- gce.ptszNick = bError ? L"" : dbv.ptszVal;
+ gce.ptszNick = bError ? L"" : dbv.pwszVal;
gce.ptszUID = mir_a2u(MyOptions.szEmail);
gce.time = time(0);
gce.ptszText = gch->ptszText;
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 7422a9ee3d..3989e25b5f 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -314,11 +314,11 @@ void CMsnProto::MSN_GetCustomSmileyFileName(MCONTACT hContact, wchar_t* pszDest, DBVARIANT dbv = { 0 };
if (getWString(hContact, "e-mail", &dbv)) {
dbv.type = DBVT_ASCIIZ;
- dbv.ptszVal = (wchar_t*)mir_alloc(11*sizeof(wchar_t));
- _ui64tow((UINT_PTR)hContact, dbv.ptszVal, 10);
+ dbv.pwszVal = (wchar_t*)mir_alloc(11*sizeof(wchar_t));
+ _ui64tow((UINT_PTR)hContact, dbv.pwszVal, 10);
}
- tPathLen += mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s", dbv.ptszVal);
+ tPathLen += mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s", dbv.pwszVal);
db_free(&dbv);
}
else {
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp index 5f2f881d1c..570fe40dab 100644 --- a/protocols/MSN/src/msn_opts.cpp +++ b/protocols/MSN/src/msn_opts.cpp @@ -99,7 +99,7 @@ static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP HWND wnd = GetDlgItem(hwndDlg, IDC_HANDLE2);
DBVARIANT dbv;
if (!proto->getWString("Nick", &dbv)) {
- SetWindowText(wnd, dbv.ptszVal);
+ SetWindowText(wnd, dbv.pwszVal);
db_free(&dbv);
}
EnableWindow(wnd, proto->msnLoggedIn);
@@ -491,7 +491,7 @@ static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, L DBVARIANT dbv;
if (!proto->getWString("Place", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_PLACE, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_PLACE, dbv.pwszVal);
db_free(&dbv);
}
}
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 567facc9e4..44b38db537 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -606,7 +606,7 @@ void __cdecl CMsnProto::MsnGetAwayMsgThread(void* arg) AwayMsgInfo *inf = (AwayMsgInfo*)arg;
DBVARIANT dbv;
if (!db_get_ws(inf->hContact, "CList", "StatusMsg", &dbv)) {
- ProtoBroadcastAck(inf->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)inf->id, (LPARAM)dbv.ptszVal);
+ ProtoBroadcastAck(inf->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)inf->id, (LPARAM)dbv.pwszVal);
db_free(&dbv);
}
else ProtoBroadcastAck(inf->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)inf->id, 0);
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp index 1bdb6cac2e..9b5ce2fdda 100644 --- a/protocols/MSN/src/msn_svcs.cpp +++ b/protocols/MSN/src/msn_svcs.cpp @@ -253,7 +253,7 @@ void CMsnProto::OnContactDeleted(MCONTACT hContact) if (isChatRoom(hContact)) {
DBVARIANT dbv;
if (!getWString(hContact, "ChatRoomID", &dbv)) {
- MSN_KillChatSession(dbv.ptszVal);
+ MSN_KillChatSession(dbv.pwszVal);
db_free(&dbv);
}
}
@@ -429,7 +429,7 @@ INT_PTR CMsnProto::OnLeaveChat(WPARAM hContact, LPARAM) if (isChatRoom(hContact) != 0) {
DBVARIANT dbv;
if (getWString(hContact, "ChatRoomID", &dbv) == 0) {
- MSN_KillChatSession(dbv.ptszVal);
+ MSN_KillChatSession(dbv.pwszVal);
db_free(&dbv);
}
}
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index 1d01d15e24..a16ed8d103 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -636,7 +636,7 @@ void CSametimeProto::UserRecvAwayMessage(MCONTACT hContact) debugLogW(L"CSametimeProto::UserRecvAwayMessage() start hContact=[%x]", hContact);
DBVARIANT dbv;
if (!db_get_s((MCONTACT)hContact, "CList", "StatusMsg", &dbv, DBVT_WCHAR)) {
- ProtoBroadcastAck((MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
+ ProtoBroadcastAck((MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.pwszVal);
db_free(&dbv);
}
else ProtoBroadcastAck((MCONTACT)hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)NULL);
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index 14a718b391..2fb2d0b445 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -78,7 +78,7 @@ MCONTACT CSkypeProto::AddContact(const char *skypename, bool isTemporary) DBVARIANT dbv;
if (!getWString(SKYPE_SETTINGS_GROUP, &dbv)) {
- db_set_ws(hContact, "CList", "Group", dbv.ptszVal);
+ db_set_ws(hContact, "CList", "Group", dbv.pwszVal);
db_free(&dbv);
}
diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp index 28bb28b4e3..af7f0774ab 100644 --- a/protocols/Twitter/src/connection.cpp +++ b/protocols/Twitter/src/connection.cpp @@ -177,7 +177,7 @@ bool TwitterProto::NegotiateConnection() }
if (!getWString(TWITTER_KEY_GROUP, &dbv)) {
- Clist_GroupCreate(0, dbv.ptszVal);
+ Clist_GroupCreate(0, dbv.pwszVal);
db_free(&dbv);
}
@@ -401,7 +401,7 @@ void TwitterProto::UpdateAvatarWorker(void *p) return;
std::string ext = data->url.substr(data->url.rfind('.')); // finds the filetype of the avatar
- std::wstring filename = GetAvatarFolder() + L'\\' + dbv.ptszVal + (wchar_t*)_A2T(ext.c_str()); // local filename and path
+ std::wstring filename = GetAvatarFolder() + L'\\' + dbv.pwszVal + (wchar_t*)_A2T(ext.c_str()); // local filename and path
db_free(&dbv);
PROTO_AVATAR_INFORMATION ai = { 0 };
@@ -537,7 +537,7 @@ void TwitterProto::ShowContactPopup(MCONTACT hContact, const std::string &text, DBVARIANT dbv;
if (!db_get_ws(hContact, "CList", "MyHandle", &dbv) || !getWString(hContact, TWITTER_KEY_UN, &dbv)) {
- wcsncpy(popup.lptzContactName, dbv.ptszVal, MAX_CONTACTNAME);
+ wcsncpy(popup.lptzContactName, dbv.pwszVal, MAX_CONTACTNAME);
db_free(&dbv);
}
diff --git a/protocols/Twitter/src/contacts.cpp b/protocols/Twitter/src/contacts.cpp index 3545862b9c..99c08ac1e9 100644 --- a/protocols/Twitter/src/contacts.cpp +++ b/protocols/Twitter/src/contacts.cpp @@ -163,7 +163,7 @@ void TwitterProto::GetAwayMsgWorker(void *arg) DBVARIANT dbv;
if (!db_get_ws(hContact, "CList", "StatusMsg", &dbv)) {
- ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
+ ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.pwszVal);
db_free(&dbv);
}
else ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_FAILED, (HANDLE)1, 0);
@@ -252,7 +252,7 @@ MCONTACT TwitterProto::AddToClientList(const char *name, const char *status) Skin_PlaySound("TwitterNewContact");
DBVARIANT dbv;
if (!getWString(TWITTER_KEY_GROUP, &dbv)) {
- db_set_ws(hContact, "CList", "Group", dbv.ptszVal);
+ db_set_ws(hContact, "CList", "Group", dbv.pwszVal);
db_free(&dbv);
}
diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp index d7164be99e..ffc6eb818a 100644 --- a/protocols/Twitter/src/ui.cpp +++ b/protocols/Twitter/src/ui.cpp @@ -40,7 +40,7 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM DBVARIANT dbv;
if (!proto->getWString(TWITTER_KEY_GROUP, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_GROUP, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_GROUP, dbv.pwszVal);
db_free(&dbv);
}
else SetDlgItemText(hwndDlg, IDC_GROUP, L"Twitter");
diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp index 377f9e5200..b9a0a492e1 100644 --- a/src/core/stdaway/src/sendmsg.cpp +++ b/src/core/stdaway/src/sendmsg.cpp @@ -89,18 +89,18 @@ static wchar_t* GetAwayMessage(int statusMode, char *szProto) DBVARIANT dbv;
if (GetStatusModeByte(statusMode, "UsePrev")) {
if (db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(statusMode, "Msg"), &dbv))
- dbv.ptszVal = mir_wstrdup(GetDefaultMessage(statusMode));
+ dbv.pwszVal = mir_wstrdup(GetDefaultMessage(statusMode));
}
else {
if (db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(statusMode, "Default"), &dbv))
- dbv.ptszVal = mir_wstrdup(GetDefaultMessage(statusMode));
+ dbv.pwszVal = mir_wstrdup(GetDefaultMessage(statusMode));
- for (int i = 0; dbv.ptszVal[i]; i++) {
- if (dbv.ptszVal[i] != '%')
+ for (int i = 0; dbv.pwszVal[i]; i++) {
+ if (dbv.pwszVal[i] != '%')
continue;
wchar_t substituteStr[128];
- if (!wcsnicmp(dbv.ptszVal + i, L"%time%", 6)) {
+ if (!wcsnicmp(dbv.pwszVal + i, L"%time%", 6)) {
MIRANDA_IDLE_INFO mii;
Idle_GetInfo(mii);
@@ -116,17 +116,17 @@ static wchar_t* GetAwayMessage(int statusMode, char *szProto) }
else GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, substituteStr, _countof(substituteStr));
}
- else if (!wcsnicmp(dbv.ptszVal + i, L"%date%", 6))
+ else if (!wcsnicmp(dbv.pwszVal + i, L"%date%", 6))
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, substituteStr, _countof(substituteStr));
else continue;
if (mir_wstrlen(substituteStr) > 6)
- dbv.ptszVal = (wchar_t*)mir_realloc(dbv.ptszVal, (mir_wstrlen(dbv.ptszVal) + 1 + mir_wstrlen(substituteStr) - 6) * sizeof(wchar_t));
- memmove(dbv.ptszVal + i + mir_wstrlen(substituteStr), dbv.ptszVal + i + 6, (mir_wstrlen(dbv.ptszVal) - i - 5) * sizeof(wchar_t));
- memcpy(dbv.ptszVal + i, substituteStr, mir_wstrlen(substituteStr) * sizeof(wchar_t));
+ dbv.pwszVal = (wchar_t*)mir_realloc(dbv.pwszVal, (mir_wstrlen(dbv.pwszVal) + 1 + mir_wstrlen(substituteStr) - 6) * sizeof(wchar_t));
+ memmove(dbv.pwszVal + i + mir_wstrlen(substituteStr), dbv.pwszVal + i + 6, (mir_wstrlen(dbv.pwszVal) - i - 5) * sizeof(wchar_t));
+ memcpy(dbv.pwszVal + i, substituteStr, mir_wstrlen(substituteStr) * sizeof(wchar_t));
}
}
- return dbv.ptszVal;
+ return dbv.pwszVal;
}
static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -390,9 +390,9 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam DBVARIANT dbv;
if (db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(it, "Default"), &dbv))
if (db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(it, "Msg"), &dbv))
- dbv.ptszVal = mir_wstrdup(GetDefaultMessage(it));
- mir_wstrcpy(dat->info[j].msg, dbv.ptszVal);
- mir_free(dbv.ptszVal);
+ dbv.pwszVal = mir_wstrdup(GetDefaultMessage(it));
+ mir_wstrcpy(dat->info[j].msg, dbv.pwszVal);
+ mir_free(dbv.pwszVal);
}
if (hLst)
SendDlgItemMessage(hwndDlg, IDC_LST_STATUS, LB_SETCURSEL, 0, 0);
diff --git a/src/core/stdfile/src/fileopts.cpp b/src/core/stdfile/src/fileopts.cpp index 6e98fb682c..41d8717635 100644 --- a/src/core/stdfile/src/fileopts.cpp +++ b/src/core/stdfile/src/fileopts.cpp @@ -91,7 +91,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L DBVARIANT dbv;
if (db_get_ws(NULL, MODULENAME, "ScanCmdLine", &dbv) == 0) {
- SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, dbv.pwszVal);
db_free(&dbv);
}
else if (SendDlgItemMessage(hwndDlg, IDC_SCANCMDLINE, CB_GETCOUNT, 0, 0)) {
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index 3db0e42786..e975d01fe8 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -216,7 +216,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l DBVARIANT dbv;
if (db_get_ws(NULL, MODULENAME, idstr, &dbv))
break;
- SendDlgItemMessage(hwndDlg, IDC_FILEDIR, CB_ADDSTRING, 0, (LPARAM)dbv.ptszVal);
+ SendDlgItemMessage(hwndDlg, IDC_FILEDIR, CB_ADDSTRING, 0, (LPARAM)dbv.pwszVal);
db_free(&dbv);
}
@@ -315,7 +315,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l mir_snprintf(idstr, "MruDir%d", i);
if (db_get_ws(NULL, MODULENAME, idstr, &dbv)) continue;
mir_snprintf(idstr, "MruDir%d", i+1);
- db_set_ws(NULL, MODULENAME, idstr, dbv.ptszVal);
+ db_set_ws(NULL, MODULENAME, idstr, dbv.pwszVal);
db_free(&dbv);
}
db_set_ws(NULL, MODULENAME, idstr, szRecvDir);
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index 841d2d0c2c..35d6884ad0 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -95,18 +95,18 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) { DBVARIANT dbv; if (!db_get_ws(NULL, MODULENAME, "ScanCmdLine", &dbv)) { - if (dbv.ptszVal[0]) { + if (dbv.pwszVal[0]) { STARTUPINFO si = { 0 }; si.cb = sizeof(si); - wchar_t *pszReplace = wcsstr(dbv.ptszVal, L"%f"); + wchar_t *pszReplace = wcsstr(dbv.pwszVal, L"%f"); wchar_t szCmdLine[768]; if (pszReplace) { if (info->szFile[mir_wstrlen(info->szFile) - 1] == '\\') info->szFile[mir_wstrlen(info->szFile) - 1] = '\0'; *pszReplace = 0; - mir_snwprintf(szCmdLine, L"%s\"%s\"%s", dbv.ptszVal, info->szFile, pszReplace + 2); + mir_snwprintf(szCmdLine, L"%s\"%s\"%s", dbv.pwszVal, info->szFile, pszReplace + 2); } else - wcsncpy_s(szCmdLine, dbv.ptszVal, _TRUNCATE); + wcsncpy_s(szCmdLine, dbv.pwszVal, _TRUNCATE); PROCESS_INFORMATION pi; if (CreateProcess(nullptr, szCmdLine, nullptr, nullptr, FALSE, 0, nullptr, nullptr, &si, &pi)) { diff --git a/src/core/stdmsg/src/chat_options.cpp b/src/core/stdmsg/src/chat_options.cpp index fc7258ce76..932ca3f07b 100644 --- a/src/core/stdmsg/src/chat_options.cpp +++ b/src/core/stdmsg/src/chat_options.cpp @@ -204,7 +204,7 @@ static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefau { DBVARIANT dbv; if (!db_get_ws(0, CHAT_MODULE, pszSetting, &dbv)) { - replaceStrW(*ppPointer, dbv.ptszVal); + replaceStrW(*ppPointer, dbv.pwszVal); db_free(&dbv); } else replaceStrW(*ppPointer, pszDefault); diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index cfb4c8d556..57711e2228 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -219,8 +219,8 @@ bool CSrmmWindow::OnInitDialog() if (m_hContact) {
DBVARIANT dbv;
if (!db_get_ws(m_hContact, SRMSGMOD, DBSAVEDMSG, &dbv)) {
- if (dbv.ptszVal[0]) {
- m_message.SetText(dbv.ptszVal);
+ if (dbv.pwszVal[0]) {
+ m_message.SetText(dbv.pwszVal);
m_btnOk.Enable(true);
UpdateReadChars();
PostMessage(m_message.GetHwnd(), EM_SETSEL, -1, -1);
diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp index bd99b262d7..d6373e2fba 100644 --- a/src/core/stduserinfo/src/contactinfo.cpp +++ b/src/core/stduserinfo/src/contactinfo.cpp @@ -293,7 +293,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP mir_snwprintf(idstr2, L"%d", i + 2);
}
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
@@ -306,7 +306,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.pszText = idstr2;
mir_snwprintf(idstr2, TranslateT("Custom %d"), i + 1);
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
@@ -322,14 +322,14 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (!db_get_ws(hContact, szProto, "Phone", &dbv)) {
lvi.pszText = TranslateT("Primary");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
if (!db_get_ws(hContact, szProto, "Fax", &dbv)) {
lvi.pszText = TranslateT("Fax");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
@@ -338,23 +338,23 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
if (mir_strlen(dbv.pszVal) > 4 && !mir_strcmp(dbv.pszVal + mir_strlen(dbv.pszVal) - 4, " SMS")) {
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, L"y");
- dbv.ptszVal[mir_wstrlen(dbv.ptszVal) - 4] = '\0';
+ dbv.pwszVal[mir_wstrlen(dbv.pwszVal) - 4] = '\0';
}
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
if (!db_get_ws(hContact, szProto, "CompanyPhone", &dbv)) {
lvi.pszText = TranslateT("Work phone");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
if (!db_get_ws(hContact, szProto, "CompanyFax", &dbv)) {
lvi.pszText = TranslateT("Work fax");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
@@ -367,11 +367,11 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP lvi.pszText = idstr2;
mir_snwprintf(idstr2, TranslateT("Custom %d"), i + 1);
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- if (mir_wstrlen(dbv.ptszVal) > 4 && !mir_wstrcmp(dbv.ptszVal + mir_wstrlen(dbv.ptszVal) - 4, L" SMS")) {
+ if (mir_wstrlen(dbv.pwszVal) > 4 && !mir_wstrcmp(dbv.pwszVal + mir_wstrlen(dbv.pwszVal) - 4, L" SMS")) {
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, L"y");
- dbv.ptszVal[mir_wstrlen(dbv.ptszVal) - 4] = '\0';
+ dbv.pwszVal[mir_wstrlen(dbv.pwszVal) - 4] = '\0';
}
- ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
+ ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.pwszVal);
db_free(&dbv);
lvi.iItem++;
}
diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp index 338007fb4f..7983a0f6ff 100644 --- a/src/core/stduserinfo/src/stdinfo.cpp +++ b/src/core/stduserinfo/src/stdinfo.cpp @@ -55,7 +55,7 @@ static wchar_t* Proto_GetContactInfoSettingStr(bool proto_service, MCONTACT hCon if (CallProtoService(szModule, PS_GETINFOSETTING, hContact, (LPARAM)&cgs))
return nullptr;
- return dbv.ptszVal;
+ return dbv.pwszVal;
}
static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule, char *szSetting, int special)
@@ -152,7 +152,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule char szSettingName[100];
mir_snprintf(szSettingName, "%sName", szSetting);
if (!db_get_ws(hContact, szModule, szSettingName, &dbv)) {
- ptstr = dbv.ptszVal;
+ ptstr = dbv.pwszVal;
unspecified = false;
break;
}
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index 5f43ae35a7..4a1385545b 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -266,7 +266,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP LPTSTR ptszLastTab;
DBVARIANT dbv;
if (!db_get_ws(NULL, MODULENAME, "LastTab", &dbv)) {
- ptszLastTab = NEWWSTR_ALLOCA(dbv.ptszVal);
+ ptszLastTab = NEWWSTR_ALLOCA(dbv.pwszVal);
db_free(&dbv);
}
else ptszLastTab = nullptr;
diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp index 1a6a242a01..6850899677 100644 --- a/src/mir_app/src/chat_opts.cpp +++ b/src/mir_app/src/chat_opts.cpp @@ -195,7 +195,7 @@ static void InitSetting(wchar_t** ppPointer, char* pszSetting, wchar_t* pszDefau {
DBVARIANT dbv;
if (!db_get_ws(0, CHAT_MODULE, pszSetting, &dbv)) {
- replaceStrW(*ppPointer, dbv.ptszVal);
+ replaceStrW(*ppPointer, dbv.pwszVal);
db_free(&dbv);
}
else replaceStrW(*ppPointer, pszDefault);
diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp index 8c35188d75..851dfaf549 100644 --- a/src/mir_app/src/clcitems.cpp +++ b/src/mir_app/src/clcitems.cpp @@ -322,15 +322,15 @@ MIR_APP_DLL(void) Clist_DeleteItemFromTree(HWND hwnd, MCONTACT hItem) ClcContact *cc = group->cl[i]; if (cc->type == CLCIT_GROUP) { size_t len = mir_wstrlen(cc->szText); - if (!wcsncmp(cc->szText, dbv.ptszVal + nameOffset, len) && - (dbv.ptszVal[nameOffset + len] == '\\' || dbv.ptszVal[nameOffset + len] == '\0')) { + if (!wcsncmp(cc->szText, dbv.pwszVal + nameOffset, len) && + (dbv.pwszVal[nameOffset + len] == '\\' || dbv.pwszVal[nameOffset + len] == '\0')) { group->totalMembers--; - if (dbv.ptszVal[nameOffset + len] == '\0') + if (dbv.pwszVal[nameOffset + len] == '\0') break; } } } - mir_free(dbv.ptszVal); + mir_free(dbv.pwszVal); } else Clist_RemoveItemFromGroup(hwnd, group, contact, 1); } diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp index cc8020975c..37fb40cd66 100644 --- a/src/mir_app/src/clistsettings.cpp +++ b/src/mir_app/src/clistsettings.cpp @@ -186,7 +186,7 @@ static void Dbwcs2tstr(DBCONTACTWRITESETTING *cws, wchar_t* &pStr) break;
case DBVT_WCHAR:
- pStr = mir_wstrdup(cws->value.ptszVal);
+ pStr = mir_wstrdup(cws->value.pwszVal);
break;
}
}
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 4079bdc675..740cd7004b 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -300,7 +300,7 @@ int LoadCLUIModule(void) if (db_get_ws(0, "CList", "TitleText", &dbv))
mir_wstrncpy(titleText, _T(MIRANDANAME), _countof(titleText));
else {
- mir_wstrncpy(titleText, dbv.ptszVal, _countof(titleText));
+ mir_wstrncpy(titleText, dbv.pwszVal, _countof(titleText));
db_free(&dbv);
}
diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index 0c13ddb594..1ce2f46b4b 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -63,7 +63,7 @@ static wchar_t* ProcessDatabaseValueDefault(MCONTACT hContact, const char *szPro if (!dbv.pszVal[0]) break;
case DBVT_WCHAR:
if (!dbv.pwszVal[0]) break;
- return dbv.ptszVal;
+ return dbv.pwszVal;
}
db_free(&dbv);
}
@@ -143,7 +143,7 @@ MIR_APP_DLL(wchar_t*) Contact_GetInfo(int type, MCONTACT hContact, const char *s case CNF_COUNTRY:
case CNF_COCOUNTRY:
if (!GetDatabaseString(hContact, szProto, type == CNF_COUNTRY ? "CountryName" : "CompanyCountryName", &dbv))
- return dbv.ptszVal;
+ return dbv.pwszVal;
if (!db_get(hContact, szProto, type == CNF_COUNTRY ? "Country" : "CompanyCountry", &dbv)) {
if (dbv.type == DBVT_WORD) {
@@ -237,7 +237,7 @@ MIR_APP_DLL(wchar_t*) Contact_GetInfo(int type, MCONTACT hContact, const char *s _ltow(value, buf, 10);
return mir_wstrdup(buf);
}
- return dbv.ptszVal;
+ return dbv.pwszVal;
}
}
break;
diff --git a/src/mir_app/src/meta_edit.cpp b/src/mir_app/src/meta_edit.cpp index 2b740d8b79..9d6b9f4799 100644 --- a/src/mir_app/src/meta_edit.cpp +++ b/src/mir_app/src/meta_edit.cpp @@ -74,7 +74,7 @@ static void FillContactList(HWND hList) wcsncpy_s(buff, _A2T(dbv.pszVal), _TRUNCATE);
break;
case DBVT_WCHAR:
- wcsncpy_s(buff, dbv.ptszVal, _TRUNCATE);
+ wcsncpy_s(buff, dbv.pwszVal, _TRUNCATE);
break;
case DBVT_BYTE:
_itow(dbv.bVal, buff, 10);
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 4a67acce15..d5da2e557c 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -285,17 +285,14 @@ int Meta_HandleACK(WPARAM, LPARAM lParam) // change the hContact in the avatar info struct, if it's the avatar we're using - else drop it
if (ack->type == ACKTYPE_AVATAR) {
if (ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED || ack->result == ACKRESULT_STATUS) {
- DBVARIANT dbv;
-
// change avatar if the most online supporting avatars changes, or if we don't have one
MCONTACT hMostOnline = Meta_GetMostOnlineSupporting(cc, PFLAGNUM_4, PF4_AVATARS);
if (ack->hContact == 0 || ack->hContact != hMostOnline)
return 0;
- if (!db_get(ack->hContact, "ContactPhoto", "File", &dbv)) {
- db_set_ws(cc->contactID, "ContactPhoto", "File", dbv.ptszVal);
- db_free(&dbv);
- }
+ ptrW wszFile(db_get_wsa(ack->hContact, "ContactPhoto", "File"));
+ if (wszFile)
+ db_set_ws(cc->contactID, "ContactPhoto", "File", wszFile);
if (ack->hProcess) {
PROTO_AVATAR_INFORMATION ai;
@@ -403,7 +400,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) DBVARIANT dbv;
if (proto && !db_get_ws(hContact, proto, "Nick", &dbv)) {
- db_set_ws(ccMeta->contactID, META_PROTO, buffer, dbv.ptszVal);
+ db_set_ws(ccMeta->contactID, META_PROTO, buffer, dbv.pwszVal);
db_free(&dbv);
}
else db_unset(ccMeta->contactID, META_PROTO, buffer);
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp index 7e23871cfd..b0b6da5ef1 100644 --- a/src/mir_app/src/movetogroup.cpp +++ b/src/mir_app/src/movetogroup.cpp @@ -108,10 +108,10 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) if (db_get_ws(0, "CListGroups", intname, &dbv))
break;
- if (dbv.ptszVal[0])
- groups.insert(new GroupItemSort(dbv.ptszVal + 1, i + 1));
+ if (dbv.pwszVal[0])
+ groups.insert(new GroupItemSort(dbv.pwszVal + 1, i + 1));
- mir_free(dbv.ptszVal);
+ mir_free(dbv.pwszVal);
}
for (auto &p : groups) {
diff --git a/src/mir_app/src/sounds.cpp b/src/mir_app/src/sounds.cpp index 607f8f1eb7..502a945cb5 100644 --- a/src/mir_app/src/sounds.cpp +++ b/src/mir_app/src/sounds.cpp @@ -259,7 +259,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM DBVARIANT dbv;
if (!db_get_ws(0, "SkinSounds", p->name, &dbv)) {
wchar_t szPathFull[MAX_PATH];
- PathToAbsoluteW(dbv.ptszVal, szPathFull);
+ PathToAbsoluteW(dbv.pwszVal, szPathFull);
NotifyEventHooks(hPlayEvent, 1, (LPARAM)szPathFull);
db_free(&dbv);
}
@@ -289,7 +289,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (db_get_b(0, "SkinSoundsOff", p->name, 0) == 0) {
DBVARIANT dbv;
if (db_get_ws(0, "SkinSounds", p->name, &dbv) == 0) {
- PathToAbsoluteW(dbv.ptszVal, strdir);
+ PathToAbsoluteW(dbv.pwszVal, strdir);
db_free(&dbv);
}
}
@@ -393,7 +393,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM else {
DBVARIANT dbv;
if (!db_get_ws(0, "SkinSounds", p->name, &dbv)) {
- SetDlgItemText(hwndDlg, IDC_LOCATION, dbv.ptszVal);
+ SetDlgItemText(hwndDlg, IDC_LOCATION, dbv.pwszVal);
db_free(&dbv);
}
else SetDlgItemText(hwndDlg, IDC_LOCATION, TranslateT("<not specified>"));
diff --git a/src/mir_core/src/CDbLink.cpp b/src/mir_core/src/CDbLink.cpp index f9ab9c7d34..a71d1f1398 100644 --- a/src/mir_core/src/CDbLink.cpp +++ b/src/mir_core/src/CDbLink.cpp @@ -77,7 +77,7 @@ wchar_t* CDbLink::LoadText() if (dbv.type != DBVT_DELETED) db_free(&dbv);
if (!db_get_ws(0, m_szModule, m_szSetting, &dbv)) {
if (dbv.type == DBVT_WCHAR)
- return dbv.ptszVal;
+ return dbv.pwszVal;
return m_szDefault;
}
diff --git a/src/mir_core/src/timezones.cpp b/src/mir_core/src/timezones.cpp index b47cc144b8..d005092352 100644 --- a/src/mir_core/src/timezones.cpp +++ b/src/mir_core/src/timezones.cpp @@ -241,7 +241,7 @@ MIR_CORE_DLL(HANDLE) TimeZone_CreateByContact(MCONTACT hContact, LPCSTR szModule DBVARIANT dbv;
if (!db_get_ws(hContact, szModule, "TzName", &dbv)) {
- HANDLE res = TimeZone_CreateByName(dbv.ptszVal, dwFlags);
+ HANDLE res = TimeZone_CreateByName(dbv.pwszVal, dwFlags);
db_free(&dbv);
if (res) return res;
}
@@ -250,7 +250,7 @@ MIR_CORE_DLL(HANDLE) TimeZone_CreateByContact(MCONTACT hContact, LPCSTR szModule if (timezone == -1) {
char *szProto = GetContactProto(hContact);
if (!db_get_ws(hContact, szProto, "TzName", &dbv)) {
- HANDLE res = TimeZone_CreateByName(dbv.ptszVal, dwFlags);
+ HANDLE res = TimeZone_CreateByName(dbv.pwszVal, dwFlags);
db_free(&dbv);
if (res) return res;
}
diff --git a/utils/mir_options.cpp b/utils/mir_options.cpp index 65716a8d16..8972e27bb9 100644 --- a/utils/mir_options.cpp +++ b/utils/mir_options.cpp @@ -38,7 +38,7 @@ static wchar_t* MyDBGetContactSettingTString(MCONTACT hContact, char* module, ch out[0] = '\0'; if (!db_get_ws(hContact, module, setting, &dbv)) { - mir_wstrncpy(out, dbv.ptszVal, (int)len); + mir_wstrncpy(out, dbv.pwszVal, (int)len); db_free(&dbv); } else { |