Author: gedmurphy
Date: Tue Jul 7 20:33:54 2015
New Revision: 68376
URL:
http://svn.reactos.org/svn/reactos?rev=68376&view=rev
Log:
Minor code cleanup
Removed:
trunk/reactos/dll/win32/devmgr_new/devmgmt/Resource.h
trunk/reactos/dll/win32/devmgr_new/devmgmt/lang/
trunk/reactos/dll/win32/devmgr_new/devmgmt/res/
trunk/reactos/dll/win32/devmgr_new/devmgmt/rsrc.rc
Modified:
trunk/reactos/dll/win32/devmgr_new/devmgmt/DeviceView.cpp
trunk/reactos/dll/win32/devmgr_new/devmgmt/MainWindow.cpp
trunk/reactos/dll/win32/devmgr_new/devmgmt/devmgmt.h
trunk/reactos/dll/win32/devmgr_new/devmgr.rc
trunk/reactos/dll/win32/devmgr_new/lang/en-US.rc
Modified: trunk/reactos/dll/win32/devmgr_new/devmgmt/DeviceView.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/devmg…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/devmgmt/DeviceView.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/devmgmt/DeviceView.cpp [iso-8859-1] Tue Jul 7
20:33:54 2015
@@ -204,7 +204,7 @@
m_ViewType = Type;
RefreshThreadData *ThreadData;
- ThreadData = new RefreshThreadData();
+ ThreadData = new RefreshThreadData;
ThreadData->This = this;
ThreadData->ScanForChanges = ScanForChanges;
ThreadData->UpdateView = UpdateView;
@@ -222,11 +222,10 @@
HANDLE hThread;
hThread = (HANDLE)_beginthreadex(NULL,
0,
- &RefreshThread,
+ RefreshThread,
ThreadData,
0,
NULL);
-
if (hThread) CloseHandle(hThread);
}
@@ -479,7 +478,7 @@
// Get the cached class node
ClassNode = GetClassNode(&ClassGuid);
- if (ClassNode == NULL)
+ if (ClassNode == nullptr)
{
ATLASSERT(FALSE);
ClassIndex++;
@@ -520,7 +519,7 @@
// Get the cached device node
DeviceNode = GetDeviceNode(DeviceInfoData.DevInst);
- if (DeviceNode == NULL)
+ if (DeviceNode == nullptr)
{
ATLASSERT(bClassUnknown == true);
DeviceIndex++;
@@ -1021,13 +1020,14 @@
CClassNode *Node;
Pos = m_ClassNodeList.GetHeadPosition();
+ if (Pos == NULL) return nullptr;
do
{
Node = m_ClassNodeList.GetNext(Pos);
if (IsEqualGUID(*Node->GetClassGuid(), *ClassGuid))
{
- //ATLASSERT(Node->GetType() == NodeClass);
+ ATLASSERT(Node->GetNodeType() == ClassNode);
break;
}
@@ -1047,13 +1047,14 @@
CDeviceNode *Node;
Pos = m_DeviceNodeList.GetHeadPosition();
+ if (Pos == NULL) return nullptr;
do
{
Node = m_DeviceNodeList.GetNext(Pos);
if (Node->GetDeviceInst() == Device)
{
- //ATLASSERT(Node->GetType() == NodeDevice);
+ ATLASSERT(Node->GetNodeType() == DeviceNode);
break;
}
@@ -1112,6 +1113,7 @@
if (m_RootNode) delete m_RootNode;
m_RootNode = new CRootNode(&m_ImageListData);
m_RootNode->SetupNode();
+
// Loop through all the classes
do
{
@@ -1155,6 +1157,11 @@
{
m_DeviceNodeList.AddTail(DeviceNode);
}
+ else
+ {
+ ATLASSERT(FALSE);
+ }
+
}
SetupDiDestroyDeviceInfoList(hDevInfo);
Modified: trunk/reactos/dll/win32/devmgr_new/devmgmt/MainWindow.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/devmg…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/devmgmt/MainWindow.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/devmgmt/MainWindow.cpp [iso-8859-1] Tue Jul 7
20:33:54 2015
@@ -788,6 +788,7 @@
HINSTANCE g_hInstance = NULL;
HANDLE ProcessHeap = NULL;
+
BOOL
WINAPI
DeviceManager_ExecuteW(HWND /*hWndParent*/,
@@ -809,6 +810,9 @@
icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES;
InitCommonControlsEx(&icex);
+ //__debugbreak();
+ g_hInstance = GetModuleHandle(L"devmgr.dll");
+
// Load the application name
if (szAppName.LoadStringW(g_hInstance, IDS_APPNAME))
{
Removed: trunk/reactos/dll/win32/devmgr_new/devmgmt/Resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/devmg…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/devmgmt/Resource.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/devmgmt/Resource.h (removed)
@@ -1,84 +0,0 @@
-#define IDC_STATIC -1
-
-#define IDS_APPNAME 10
-
-#define IDI_MAIN_ICON 20
-#define IDB_ROOT_IMAGE 21
-#define IDB_TOOLBAR 22
-
-/* windows */
-#define IDC_TREEVIEW 50
-#define IDC_TOOLBAR 51
-#define IDC_STATUSBAR 52
-#define IDR_MAINMENU 53
-#define IDR_POPUP 54
-
-/* Actions */
-#define IDC_PROPERTIES 100
-#define IDC_SCAN_HARDWARE 101
-#define IDC_ENABLE_DRV 102
-#define IDC_DISABLE_DRV 103
-#define IDC_UPDATE_DRV 104
-#define IDC_UNINSTALL_DRV 105
-#define IDC_ADD_HARDWARE 106
-
-/* Menu items */
-#define IDC_ACTIONMENU 150
-#define IDC_ABOUT 151
-#define IDC_EXIT 152
-
-
-/* view menu */
-#define IDC_DEVBYTYPE 200
-#define IDC_DEVBYCONN 201
-#define IDC_RESBYTYPE 202
-#define IDC_RESBYCONN 203
-#define IDC_SHOWHIDDEN 204
-
-
-/* tooltips */
-#define IDS_TOOLTIP_PROPERTIES 300
-#define IDS_TOOLTIP_SCAN 301
-#define IDS_TOOLTIP_ENABLE 302
-#define IDS_TOOLTIP_DISABLE 303
-#define IDS_TOOLTIP_UPDATE 304
-#define IDS_TOOLTIP_UNINSTALL 305
-
-/* General strings */
-#define IDS_CONFIRM_DISABLE 400
-
-/* Menu strings */
-#define IDS_MENU_UPDATE 500
-#define IDS_MENU_ENABLE 501
-#define IDS_MENU_DISABLE 502
-#define IDS_MENU_UNINSTALL 503
-#define IDS_MENU_SCAN 504
-#define IDS_MENU_ADD 505
-#define IDS_MENU_PROPERTIES 506
-
-
-/* menu hints */
-#define IDS_HINT_BLANK 1000
-#define IDS_HINT_PROPERTIES 1001
-#define IDS_HINT_SCAN 1002
-#define IDS_HINT_ENABLE 1003
-#define IDS_HINT_DISABLE 1004
-#define IDS_HINT_UPDATE 1005
-#define IDS_HINT_UNINSTALL 1006
-#define IDS_HINT_ADD 1007
-#define IDS_HINT_ABOUT 20008
-#define IDS_HINT_EXIT 20009
-
-#define IDS_HINT_DEV_BY_TYPE 20020
-#define IDS_HINT_DEV_BY_CONN 20021
-#define IDS_HINT_RES_BY_TYPE 20022
-#define IDS_HINT_RES_BY_CONN 20023
-#define IDS_HINT_SHOW_HIDDEN 20024
-
-/* system menu hints */
-#define IDS_HINT_SYS_RESTORE 21001
-#define IDS_HINT_SYS_MOVE 21002
-#define IDS_HINT_SYS_SIZE 21003
-#define IDS_HINT_SYS_MINIMIZE 21004
-#define IDS_HINT_SYS_MAXIMIZE 21005
-#define IDS_HINT_SYS_CLOSE 21006
Modified: trunk/reactos/dll/win32/devmgr_new/devmgmt/devmgmt.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/devmg…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/devmgmt/devmgmt.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/devmgmt/devmgmt.h [iso-8859-1] Tue Jul 7 20:33:54
2015
@@ -2,7 +2,7 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#pragma once
-#include "resource.h"
+#include "..\resource.h"
extern HINSTANCE g_hInstance;
extern HANDLE ProcessHeap;
Removed: trunk/reactos/dll/win32/devmgr_new/devmgmt/rsrc.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/devmg…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/devmgmt/rsrc.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/devmgmt/rsrc.rc (removed)
@@ -1,80 +0,0 @@
-#include <windows.h>
-#include "resource.h"
-
-LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-
-IDI_MAIN_ICON ICON "res/computer.ico"
-IDB_ROOT_IMAGE BITMAP "res/root.bmp"
-
-/* main toolbar icons */
-IDB_TOOLBAR BITMAP DISCARDABLE "res/toolbar.bmp"
-
-// UTF-8
-#pragma code_page(65001)
-
-#ifdef LANGUAGE_BG_BG
- #include "lang/bg-BG.rc"
-#endif
-#ifdef LANGUAGE_DE_DE
- #include "lang/de-DE.rc"
-#endif
-#ifdef LANGUAGE_EL_GR
- #include "lang/el-GR.rc"
-#endif
-#ifdef LANGUAGE_EN_US
- #include "lang/en-US.rc"
-#endif
-#ifdef LANGUAGE_ES_ES
- #include "lang/es-ES.rc"
-#endif
-#ifdef LANGUAGE_FR_FR
- #include "lang/fr-FR.rc"
-#endif
-#ifdef LANGUAGE_HE_IL
- #include "lang/he-IL.rc"
-#endif
-#ifdef LANGUAGE_ID_ID
- #include "lang/id-ID.rc"
-#endif
-#ifdef LANGUAGE_IT_IT
- #include "lang/it-IT.rc"
-#endif
-#ifdef LANGUAGE_JA_JP
- #include "lang/ja-JP.rc"
-#endif
-#ifdef LANGUAGE_KO_KR
- #include "lang/ko-KR.rc"
-#endif
-#ifdef LANGUAGE_NB_NO
- #include "lang/no-NO.rc"
-#endif
-#ifdef LANGUAGE_PL_PL
- #include "lang/pl-PL.rc"
-#endif
-#ifdef LANGUAGE_PT_BR
- #include "lang/pt-BR.rc"
-#endif
-#ifdef LANGUAGE_RO_RO
- #include "lang/ro-RO.rc"
-#endif
-#ifdef LANGUAGE_RU_RU
- #include "lang/ru-RU.rc"
-#endif
-#ifdef LANGUAGE_SK_SK
- #include "lang/sk-SK.rc"
-#endif
-#ifdef LANGUAGE_SV_SE
- #include "lang/sv-SE.rc"
-#endif
-#ifdef LANGUAGE_TH_TH
- #include "lang/th-TH.rc"
-#endif
-#ifdef LANGUAGE_TR_TR
- #include "lang/tr-TR.rc"
-#endif
-#ifdef LANGUAGE_UK_UA
- #include "lang/uk-UA.rc"
-#endif
-#ifdef LANGUAGE_ZH_CN
- #include "lang/zh-CN.rc"
-#endif
Modified: trunk/reactos/dll/win32/devmgr_new/devmgr.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/devmg…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/devmgr.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/devmgr.rc [iso-8859-1] Tue Jul 7 20:33:54 2015
@@ -4,13 +4,15 @@
#include "resource.h"
-LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Device Manager"
#define REACTOS_STR_INTERNAL_NAME "devmgr"
#define REACTOS_STR_ORIGINAL_FILENAME "devmgr.dll"
+
#include <reactos/version.rc>
+#include <reactos/manifest_dll.rc>
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDI_MAIN_ICON ICON "resources/computer.ico"
IDB_ROOT_IMAGE BITMAP "resources/root.bmp"
@@ -18,70 +20,7 @@
/* main toolbar icons */
IDB_TOOLBAR BITMAP DISCARDABLE "resources/toolbar.bmp"
-#include <reactos/manifest_dll.rc>
-
-#define LANGUAGE_EN_US
-
/* UTF-8 */
#pragma code_page(65001)
-#ifdef LANGUAGE_BG_BG
- #include "lang/bg-BG.rc"
-#endif
-#ifdef LANGUAGE_CS_CZ
- #include "lang/cs-CZ.rc"
-#endif
-#ifdef LANGUAGE_DE_DE
- #include "lang/de-DE.rc"
-#endif
-#ifdef LANGUAGE_EL_GR
- #include "lang/el-GR.rc"
-#endif
-#ifdef LANGUAGE_EN_US
- #include "lang/en-US.rc"
-#endif
-#ifdef LANGUAGE_ES_ES
- #include "lang/es-ES.rc"
-#endif
-#ifdef LANGUAGE_HE_IL
- #include "lang/he-IL.rc"
-#endif
-#ifdef LANGUAGE_FR_FR
- #include "lang/fr-FR.rc"
-#endif
-#ifdef LANGUAGE_HU_HU
- #include "lang/hu-HU.rc"
-#endif
-#ifdef LANGUAGE_ID_ID
- #include "lang/id-ID.rc"
-#endif
-#ifdef LANGUAGE_IT_IT
- #include "lang/it-IT.rc"
-#endif
-#ifdef LANGUAGE_NB_NO
- #include "lang/no-NO.rc"
-#endif
-#ifdef LANGUAGE_PL_PL
- #include "lang/pl-PL.rc"
-#endif
-#ifdef LANGUAGE_PT_BR
- #include "lang/pt-BR.rc"
-#endif
-#ifdef LANGUAGE_RO_RO
- #include "lang/ro-RO.rc"
-#endif
-#ifdef LANGUAGE_RU_RU
- #include "lang/ru-RU.rc"
-#endif
-#ifdef LANGUAGE_SK_SK
- #include "lang/sk-SK.rc"
-#endif
-#ifdef LANGUAGE_SQ_AL
- #include "lang/sq-AL.rc"
-#endif
-#ifdef LANGUAGE_TR_TR
- #include "lang/tr-TR.rc"
-#endif
-#ifdef LANGUAGE_UK_UA
- #include "lang/uk-UA.rc"
-#endif
+#include "lang/en-US.rc"
Modified: trunk/reactos/dll/win32/devmgr_new/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/lang/…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/lang/en-US.rc [iso-8859-1] Tue Jul 7 20:33:54
2015
@@ -266,6 +266,7 @@
STRINGTABLE DISCARDABLE
BEGIN
+ IDS_APPNAME "ReactOS Device Manager"
IDS_CONFIRM_DISABLE "Disabling this device will cause it to stop
functioning.\r\nDo you really want to disable it?"
END
STRINGTABLE DISCARDABLE
@@ -292,7 +293,6 @@
/* Hints */
STRINGTABLE DISCARDABLE
BEGIN
- IDS_APPNAME "ReactOS Device Manager"
IDS_HINT_BLANK " "
IDS_HINT_PROPERTIES " Open property dialog for the current selection."
IDS_HINT_SCAN " Scan for changed or new plug and play devices."