From de8a2594e827944b81bce766331eb3b006b23972 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sun, 23 Nov 2003 20:00:43 +0000 Subject: [PATCH] QuickLaunchBar-CONTEXT information svn path=/trunk/; revision=6768 --- reactos/subsys/system/explorer/taskbar/quicklaunch.cpp | 10 +++++++++- reactos/subsys/system/explorer/utility/utility.h | 8 ++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp b/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp index 32b03812319..0c30fb5fd19 100644 --- a/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp +++ b/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp @@ -51,6 +51,8 @@ QuickLaunchMap::~QuickLaunchMap() QuickLaunchBar::QuickLaunchBar(HWND hwnd) : super(hwnd) { + CONTEXT("QuickLaunchBar::QuickLaunchBar()"); + _dir = NULL; _next_id = IDC_FIRST_QUICK_ID; @@ -70,6 +72,8 @@ QuickLaunchBar::~QuickLaunchBar() HWND QuickLaunchBar::Create(HWND hwndParent) { + CONTEXT("QuickLaunchBar::Create()"); + ClientRect clnt(hwndParent); HWND hwnd = CreateToolbarEx(hwndParent, @@ -85,12 +89,14 @@ HWND QuickLaunchBar::Create(HWND hwndParent) void QuickLaunchBar::AddShortcuts() { + CONTEXT("QuickLaunchBar::AddShortcuts()"); + WaitCursor wait; try { TCHAR path[_MAX_PATH]; - SpecialFolderFSPath app_data(CSIDL_APPDATA, _hwnd); + SpecialFolderFSPath app_data(CSIDL_APPDATA, _hwnd); // perhaps also look into CSIDL_COMMON_APPDATA ? _stprintf(path, TEXT("%s\\")QUICKLAUNCH_FOLDER, (LPCTSTR)app_data); @@ -157,6 +163,8 @@ LRESULT QuickLaunchBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) int QuickLaunchBar::Command(int id, int code) { + CONTEXT("QuickLaunchBar::Command()"); + _entries[id]._entry->launch_entry(_hwnd); return 0; diff --git a/reactos/subsys/system/explorer/utility/utility.h b/reactos/subsys/system/explorer/utility/utility.h index 55989187256..9841a639abd 100644 --- a/reactos/subsys/system/explorer/utility/utility.h +++ b/reactos/subsys/system/explorer/utility/utility.h @@ -578,7 +578,9 @@ struct ANS { int l = wcslen(s) + 1; _str = (LPSTR) malloc(2*l); - WideCharToMultiByte(CP_ACP, 0, s, -1, _str, 2*l, 0, 0); + + if (WideCharToMultiByte(CP_ACP, 0, s, -1, _str, 2*l, 0, 0) <= 0) + *_str = '\0'; } ~ANS() @@ -604,7 +606,9 @@ struct UNC { int l = strlen(s) + 1; _str = (LPWSTR) malloc(2*l); - MultiByteToWideChar(CP_ACP, 0, s, -1, _str, l); + + if (MultiByteToWideChar(CP_ACP, 0, s, -1, _str, l) <= 0) + *_str = '\0'; } ~UNC()