Author: gedmurphy Date: Tue Jun 16 12:22:14 2015 New Revision: 68163
URL: http://svn.reactos.org/svn/reactos?rev=68163&view=rev Log: [DEVMGMT] The new device manager will be located in devmgr.dll
Added: trunk/reactos/base/applications/mscutils/devmgmt_new/CMakeLists.txt (with props) Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/DeviceView.cpp trunk/reactos/base/applications/mscutils/devmgmt_new/DeviceView.h trunk/reactos/base/applications/mscutils/devmgmt_new/Devices.cpp trunk/reactos/base/applications/mscutils/devmgmt_new/Devices.h trunk/reactos/base/applications/mscutils/devmgmt_new/MainWindow.cpp trunk/reactos/base/applications/mscutils/devmgmt_new/MainWindow.h trunk/reactos/base/applications/mscutils/devmgmt_new/Resource.h trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt.exe.manifest trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt_new.sln trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt_new.vcxproj trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt_new.vcxproj.filters trunk/reactos/base/applications/mscutils/devmgmt_new/lang/ trunk/reactos/base/applications/mscutils/devmgmt_new/precomp.h trunk/reactos/base/applications/mscutils/devmgmt_new/res/ trunk/reactos/base/applications/mscutils/devmgmt_new/rsrc.rc trunk/reactos/base/applications/mscutils/devmgmt_new/stdafx.cpp trunk/reactos/base/applications/mscutils/devmgmt_new/stdafx.h trunk/reactos/base/applications/mscutils/devmgmt_new/targetver.h Modified: trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt.cpp trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt.h trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt.rc
Added: trunk/reactos/base/applications/mscutils/devmgmt_new/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/CMakeLists.txt (added) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/CMakeLists.txt [iso-8859-1] Tue Jun 16 12:22:14 2015 @@ -0,0 +1,8 @@ + +list(APPEND SOURCE + devmgmt.cpp) + +add_executable(devmgmt ${SOURCE} devmgmt.rc) +set_module_type(devmgmt win32gui UNICODE) +add_importlibs(devmgmt setupapi gdi32 user32 comctl32 advapi32 devmgr msvcrt kernel32) +add_cd_file(TARGET devmgmt DESTINATION reactos/system32 FOR all)
Propchange: trunk/reactos/base/applications/mscutils/devmgmt_new/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/DeviceView.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/DeviceView.cpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/DeviceView.cpp (removed) @@ -1,686 +0,0 @@ -/* -* PROJECT: ReactOS Device Manager -* LICENSE: GPL - See COPYING in the top level directory -* FILE: base/applications/mscutils/devmgmt/deviceview.cpp -* PURPOSE: Implements the tree view which holds the devices -* COPYRIGHT: Copyright 2014 Ged Murphy gedmurphy@gmail.com -* -*/ - - -#include "stdafx.h" -#include "devmgmt.h" -#include "DeviceView.h" - - -/* DATA *********************************************/ - -#define DEVICE_NAME_LEN 256 -#define CLASS_NAME_LEN 256 -#define CLASS_DESC_LEN 256 - -INT_PTR -WINAPI -DevicePropertiesExW( - IN HWND hWndParent OPTIONAL, - IN LPCWSTR lpMachineName OPTIONAL, - IN LPCWSTR lpDeviceID OPTIONAL, - IN DWORD dwFlags OPTIONAL, - IN BOOL bShowDevMgr -); - -typedef INT_PTR(WINAPI *pDevicePropertiesExW)(HWND,LPCWSTR,LPCWSTR,DWORD,BOOL); - - -/* PUBLIC METHODS *************************************/ - -CDeviceView::CDeviceView( - HWND hMainWnd, - ListDevices List - ) : - m_Devices(NULL), - m_hMainWnd(hMainWnd), - m_hTreeView(NULL), - m_hPropertyDialog(NULL), - m_hShortcutMenu(NULL), - m_ListDevices(List), - m_ShowHidden(FALSE) -{ - m_Devices = new CDevices(); -} - -CDeviceView::~CDeviceView(void) -{ - delete m_Devices; - m_Devices = NULL; - - DestroyMenu(m_hShortcutMenu); -} - -BOOL -CDeviceView::Initialize() -{ - BOOL bSuccess; - - /* Initialize the devices class */ - bSuccess = m_Devices->Initialize(); - if (bSuccess == FALSE) return FALSE; - - /* Create Popup Menu */ - m_hShortcutMenu = LoadMenu(g_hInstance, - MAKEINTRESOURCE(IDR_POPUP)); - m_hShortcutMenu = GetSubMenu(m_hShortcutMenu, - 0); - SetMenuDefaultItem(m_hShortcutMenu, IDC_PROP, FALSE); - - - /* Create the main treeview */ - m_hTreeView = CreateWindowExW(WS_EX_CLIENTEDGE, - WC_TREEVIEW, - NULL, - WS_CHILD | WS_VISIBLE | WS_BORDER | TVS_HASLINES | - TVS_HASBUTTONS | TVS_SHOWSELALWAYS | TVS_LINESATROOT, - 0, 0, 0, 0, - m_hMainWnd, - (HMENU)IDC_TREEVIEW, - g_hInstance, - NULL); - if (m_hTreeView) - { - /* Get the devices image list */ - m_ImageList = m_Devices->GetImageList(); - - /* Set the image list against the treeview */ - (VOID)TreeView_SetImageList(m_hTreeView, - m_ImageList, - TVSIL_NORMAL); - - /* Give the treeview arrows instead of +/- boxes (on Win7) */ - SetWindowTheme(m_hTreeView, L"explorer", NULL); - } - - return !!(m_hTreeView); -} - -BOOL -CDeviceView::Uninitialize() -{ - EmptyDeviceView(); - - (VOID)m_Devices->Uninitialize(); - - return TRUE; -} - -BOOL CDeviceView::HasChildItem( - _In_ HTREEITEM Item) -{ - return (TreeView_GetChild(m_hTreeView, Item) != NULL); -} - -BOOL CDeviceView::IsRootItem( - _In_ HTREEITEM Item) -{ - return (TreeView_GetRoot(m_hTreeView) == Item); -} - -BOOL CDeviceView::IsRootItemSelected() -{ - return (TreeView_GetRoot(m_hTreeView) == TreeView_GetSelection(m_hTreeView)); -} - -VOID CDeviceView::EnableContextMenuItem( - _In_ UINT Id, - _In_ UINT Enabled) -{ - EnableMenuItem(m_hShortcutMenu, Id, Enabled); -} - -VOID -CDeviceView::ShowContextMenu( - _In_ INT xPos, - _In_ INT yPos) -{ - HTREEITEM hSelected; - POINT pt; - RECT rc; - - hSelected = TreeView_GetSelection(m_hTreeView); - - if (TreeView_GetItemRect(m_hTreeView, - hSelected, - &rc, - TRUE)) - { - if (GetCursorPos(&pt) && - ScreenToClient(m_hTreeView, &pt) && - PtInRect(&rc, pt)) - { - TrackPopupMenuEx(m_hShortcutMenu, - TPM_RIGHTBUTTON, - xPos, - yPos, - m_hMainWnd, - NULL); - } - } -} - -VOID -CDeviceView::Size( - _In_ INT x, - _In_ INT y, - _In_ INT cx, - _In_ INT cy - ) -{ - /* Resize the treeview */ - SetWindowPos(m_hTreeView, - NULL, - x, - y, - cx, - cy, - SWP_NOZORDER); -} - - -VOID -CDeviceView::Refresh() -{ - HANDLE hThread; - - /* Run on a new thread to keep the gui responsive */ - hThread = (HANDLE)_beginthreadex(NULL, - 0, - &ListDevicesThread, - this, - 0, - NULL); - - if (hThread) CloseHandle(hThread); -} - -VOID -CDeviceView::DisplayPropertySheet() -{ -#ifndef __REACTOS__ - pDevicePropertiesExW DevicePropertiesExW; - HMODULE hModule; - - hModule = LoadLibraryW(L"devmgr.dll"); - if (hModule == NULL) return; - - DevicePropertiesExW = (pDevicePropertiesExW)GetProcAddress(hModule, - "DevicePropertiesExW"); - if (DevicePropertiesExW == NULL) - { - FreeLibrary(hModule); - return; - } -#endif - - TV_ITEM tvItem; - - tvItem.hItem = TreeView_GetSelection(m_hTreeView); - tvItem.mask = TVIF_PARAM; - - if (TreeView_GetItem(m_hTreeView, &tvItem) && - (LPTSTR)tvItem.lParam != NULL) - { - DevicePropertiesExW(m_hTreeView, - NULL, - (LPTSTR)tvItem.lParam, - 1,//DPF_EXTENDED, - FALSE); - } - -#ifndef __REACTOS__ - FreeLibrary(hModule); -#endif -} - -VOID -CDeviceView::SetFocus() -{ -} - - -/* PRIVATE METHODS ********************************************/ - -unsigned int __stdcall CDeviceView::ListDevicesThread(void *Param) -{ - CDeviceView *This = (CDeviceView *)Param; - - /* Clear any existing data */ - This->EmptyDeviceView(); - - /* Reset the tree root */ - This->m_hTreeRoot = NULL; - - switch (This->m_ListDevices) - { - case DevicesByType: - (VOID)This->ListDevicesByType(); - break; - - case DevicesByConnection: - (VOID)This->ListDevicesByConnection(); - break; - - case ResourcesByType: - break; - - case ResourcesByConnection: - break; - } - return 0; -} - - -BOOL -CDeviceView::ListDevicesByType() -{ - HTREEITEM hDevItem = NULL; - GUID ClassGuid; - WCHAR ClassName[CLASS_NAME_LEN]; - WCHAR ClassDescription[CLASS_DESC_LEN]; - INT ClassIndex; - INT ClassImage; - LPTSTR DeviceId = NULL; - BOOL bSuccess; - - - /* Get the details of the root of the device tree */ - bSuccess = m_Devices->GetDeviceTreeRoot(ClassName, CLASS_NAME_LEN, &ClassImage); - if (bSuccess) - { - /* Add the root of the device tree to the treeview */ - m_hTreeRoot = InsertIntoTreeView(NULL, - ClassName, - NULL, - ClassImage, - 0); - } - - /* If something went wrong, bail */ - if (m_hTreeRoot == NULL) return FALSE; - - ClassIndex = 0; - do - { - /* Get the next device class */ - bSuccess = m_Devices->EnumClasses(ClassIndex, - &ClassGuid, - ClassName, - CLASS_NAME_LEN, - ClassDescription, - CLASS_DESC_LEN, - &ClassImage); - if (bSuccess) - { - BOOL bDevSuccess, AddedParent; - HANDLE Handle = NULL; - WCHAR DeviceName[DEVICE_NAME_LEN]; - INT DeviceIndex = 0; - BOOL MoreItems = FALSE; - BOOL DeviceHasProblem = FALSE; - ULONG DeviceStatus = 0; - ULONG ProblemNumber = 0; - ULONG OverlayImage = 0; - - AddedParent = FALSE; - - do - { - /* Enum all the devices that belong to this class */ - bDevSuccess = m_Devices->EnumDevicesForClass(&Handle, - &ClassGuid, - DeviceIndex, - &MoreItems, - DeviceName, - DEVICE_NAME_LEN, - &DeviceId, - &DeviceStatus, - &ProblemNumber); - if (bDevSuccess) - { - /* Check if this is a hidden device */ - if (DeviceStatus & DN_NO_SHOW_IN_DM) - { - if (m_ShowHidden == FALSE) - { - DeviceIndex++; - continue; - } - } - - /* Check if the device has a problem */ - if (DeviceStatus & DN_HAS_PROBLEM) - { - DeviceHasProblem = TRUE; - OverlayImage = 1; - } - - /* The disabled overlay takes precidence over the problem overlay */ - if (ProblemNumber == CM_PROB_HARDWARE_DISABLED) - { - OverlayImage = 2; - } - - - /* We have a device, we're gonna need to add the parent first */ - if (AddedParent == FALSE) - { - /* Insert the new class under the root item */ - hDevItem = InsertIntoTreeView(m_hTreeRoot, - ClassDescription, - NULL, - ClassImage, - 0); - - /* Don't add it again */ - AddedParent = TRUE; - } - - /* Add the device under the class item */ - (VOID)InsertIntoTreeView(hDevItem, - DeviceName, - (LPARAM)DeviceId, - ClassImage, - OverlayImage); - - /* Check if there's a problem with the device */ - if (DeviceHasProblem) - { - /* Expand the class */ - (VOID)TreeView_Expand(m_hTreeView, - hDevItem, - TVE_EXPAND); - } - } - - DeviceIndex++; - - } while (MoreItems); - - /* Check if this class has any devices */ - if (AddedParent == TRUE) - { - /* Sort the devices alphabetically */ - (VOID)TreeView_SortChildren(m_hTreeView, - hDevItem, - 0); - } - } - - ClassIndex++; - - } while (bSuccess); - - /* Sort the classes alphabetically */ - (VOID)TreeView_SortChildren(m_hTreeView, - m_hTreeRoot, - 0); - - /* Expand the root item */ - (VOID)TreeView_Expand(m_hTreeView, - m_hTreeRoot, - TVE_EXPAND); - - /* Pre-select the root item */ - (VOID)TreeView_SelectItem(m_hTreeView, - m_hTreeRoot); - - return 0; -} - -BOOL -CDeviceView::ListDevicesByConnection() -{ - WCHAR DeviceName[DEVICE_NAME_LEN]; - INT ClassImage; - BOOL bSuccess; - - /* Get the details of the root of the device tree */ - bSuccess = m_Devices->GetDeviceTreeRoot(DeviceName, DEVICE_NAME_LEN, &ClassImage); - if (bSuccess) - { - /* Add the root of the device tree to the treeview */ - m_hTreeRoot = InsertIntoTreeView(NULL, - DeviceName, - NULL, - ClassImage, - 0); - } - - /* Walk the device tree and add all the devices */ - RecurseChildDevices(m_Devices->GetRootDevice(), m_hTreeRoot); - - /* Expand the root item */ - (VOID)TreeView_Expand(m_hTreeView, - m_hTreeRoot, - TVE_EXPAND); - - return TRUE; -} - -VOID -CDeviceView::RecurseChildDevices( - _In_ DEVINST ParentDevice, - _In_ HTREEITEM hParentTreeItem - ) -{ - HTREEITEM hDevItem = NULL; - DEVINST Device; - WCHAR DeviceName[DEVICE_NAME_LEN]; - LPTSTR DeviceId = NULL; - INT ClassImage; - BOOL IsUnknown = FALSE; - BOOL IsHidden = FALSE; - ULONG DeviceStatus = 0; - ULONG ProblemNumber = 0; - UINT OverlayImage = 0; - BOOL bSuccess; - - /* Check if the parent has any child devices */ - if (m_Devices->GetChildDevice(ParentDevice, &Device) == FALSE) - return; - - /* Lookup the info about this device */ - bSuccess = m_Devices->GetDevice(Device, - DeviceName, - DEVICE_NAME_LEN, - &DeviceId, - &ClassImage, - &DeviceStatus, - &ProblemNumber); - if (bSuccess) - { - /* Check if this is a hidden device */ - if ((m_ShowHidden == TRUE) || (!(DeviceStatus & DN_NO_SHOW_IN_DM))) - { - /* Check if the device has a problem */ - if (DeviceStatus & DN_HAS_PROBLEM) - { - OverlayImage = 1; - } - - /* The disabled overlay takes precidence over the problem overlay */ - if (ProblemNumber == CM_PROB_HARDWARE_DISABLED) - { - OverlayImage = 2; - } - - /* Add this device to the tree under its parent */ - hDevItem = InsertIntoTreeView(hParentTreeItem, - DeviceName, - (LPARAM)DeviceId, - ClassImage, - 0); - - - if (hDevItem) - { - /* Check if this child has any children itself */ - RecurseChildDevices(Device, hDevItem); - } - } - } - - - for (;;) - { - /* Check if the parent device has anything at the same level */ - bSuccess = m_Devices->GetSiblingDevice(Device, &Device); - if (bSuccess == FALSE) break; - - /* Lookup the info about this device */ - bSuccess = m_Devices->GetDevice(Device, - DeviceName, - DEVICE_NAME_LEN, - &DeviceId, - &ClassImage, - &DeviceStatus, - &ProblemNumber); - if (bSuccess) - { - /* Check if this is a hidden device */ - if (DeviceStatus & DN_NO_SHOW_IN_DM) - { - if (m_ShowHidden == FALSE) - continue; - } - - /* Check if the device has a problem */ - if (DeviceStatus & DN_HAS_PROBLEM) - { - OverlayImage = 1; - } - - /* The disabled overlay takes precidence over the problem overlay */ - if (ProblemNumber == CM_PROB_HARDWARE_DISABLED) - { - OverlayImage = 2; - } - - - /* Add this device to the tree under its parent */ - hDevItem = InsertIntoTreeView(hParentTreeItem, - DeviceName, - (LPARAM)DeviceId, - ClassImage, - 0); - if (hDevItem) - { - /* Check if this child has any children itself */ - RecurseChildDevices(Device, hDevItem); - } - } - } - - (void)TreeView_SortChildren(m_hTreeView, - hParentTreeItem, - 0); -} - - HTREEITEM -CDeviceView::InsertIntoTreeView( - _In_ HTREEITEM hParent, - _In_z_ LPWSTR lpLabel, - _In_ LPARAM lParam, - _In_ INT DevImage, - _In_ UINT OverlayImage - ) -{ - TV_ITEMW tvi; - TV_INSERTSTRUCT tvins; - - ZeroMemory(&tvi, sizeof(tvi)); - ZeroMemory(&tvins, sizeof(tvins)); - - tvi.mask = TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE; - tvi.pszText = lpLabel; - tvi.cchTextMax = wcslen(lpLabel); - tvi.lParam = lParam; - tvi.iImage = DevImage; - tvi.iSelectedImage = DevImage; - - if (OverlayImage != 0) - { - tvi.mask |= TVIF_STATE; - tvi.stateMask = TVIS_OVERLAYMASK; - tvi.state = INDEXTOOVERLAYMASK(OverlayImage); - } - - tvins.item = tvi; - tvins.hParent = hParent; - - return TreeView_InsertItem(m_hTreeView, &tvins); -} - -VOID -CDeviceView::RecurseDeviceView( - _In_ HTREEITEM hParentItem - ) -{ - HTREEITEM hItem; - TVITEMW tvItem; - - /* Check if this node has any children */ - hItem = TreeView_GetChild(m_hTreeView, hParentItem); - if (hItem == NULL) return; - - /* The lParam contains the device id */ - tvItem.hItem = hItem; - tvItem.mask = TVIF_PARAM; - - /* Get the item data */ - if (TreeView_GetItem(m_hTreeView, &tvItem) && - tvItem.lParam != NULL) - { - /* Free the device id */ - HeapFree(GetProcessHeap(), 0, (LPVOID)tvItem.lParam); - } - - /* This node may have its own children */ - RecurseDeviceView(hItem); - - for (;;) - { - /* Get the next item at this level */ - hItem = TreeView_GetNextSibling(m_hTreeView, hItem); - if (hItem == NULL) break; - - /* The lParam contains the device id */ - tvItem.hItem = hItem; - tvItem.mask = TVIF_PARAM; - - /* Get the item data and free the device id */ - if (TreeView_GetItem(m_hTreeView, &tvItem)) - { - if (tvItem.lParam != NULL) - HeapFree(GetProcessHeap(), 0, (LPVOID)tvItem.lParam); - } - - /* This node may have its own children */ - RecurseDeviceView(hItem); - } -} - - -VOID -CDeviceView::EmptyDeviceView() -{ - HTREEITEM hItem; - - /* Check if there are any items in the tree */ - hItem = TreeView_GetRoot(m_hTreeView); - if (hItem == NULL) return; - - /* Free all the Device Ids */ - RecurseDeviceView(hItem); - - /* Delete all the items */ - (VOID)TreeView_DeleteAllItems(m_hTreeView); -}
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/DeviceView.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/DeviceView.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/DeviceView.h (removed) @@ -1,113 +0,0 @@ -#pragma once -#include "Devices.h" - -enum ListDevices -{ - DevicesByType, - DevicesByConnection, - ResourcesByType, - ResourcesByConnection -}; - -class CDeviceView : public CDevices -{ - CDevices *m_Devices; - HWND m_hMainWnd; - HWND m_hTreeView; - HWND m_hPropertyDialog; - HMENU m_hShortcutMenu; - ListDevices m_ListDevices; - - HIMAGELIST m_ImageList; - HTREEITEM m_hTreeRoot; - - BOOL m_ShowHidden; - -public: - CDeviceView( - HWND hMainWnd, - ListDevices List - ); - - ~CDeviceView(void); - - BOOL Initialize(); - BOOL Uninitialize(); - - VOID EnableContextMenuItem( - _In_ UINT Id, - _In_ UINT Enabled - ); - - VOID ShowContextMenu( - _In_ INT xPos, - _In_ INT yPos - ); - - VOID Size( - _In_ INT x, - _In_ INT y, - _In_ INT cx, - _In_ INT cy - ); - - VOID Refresh(); - VOID DisplayPropertySheet(); - VOID SetFocus(); - - BOOL IsRootItemSelected(); - - BOOL IsRootItem( - _In_ HTREEITEM Item - ); - - BOOL HasChildItem( - _In_ HTREEITEM Item - ); - - VOID SetDeviceListType(ListDevices List) - { - m_ListDevices = List; - } - - ListDevices GetDeviceListType() - { - return m_ListDevices; - } - - VOID ShowHiddenDevices(_In_ BOOL ShowHidden) - { - m_ShowHidden = ShowHidden; - } - -private: - static unsigned int __stdcall ListDevicesThread( - void *Param - ); - - BOOL ListDevicesByConnection( - ); - BOOL ListDevicesByType( - ); - - VOID RecurseChildDevices( - _In_ DEVINST ParentDevice, - _In_ HTREEITEM hParentTreeItem - ); - - HTREEITEM InsertIntoTreeView( - _In_ HTREEITEM hParent, - _In_z_ LPWSTR lpLabel, - _In_ LPARAM lParam, - _In_ INT DevImage, - _In_ UINT OverlayImage - ); - - VOID RecurseDeviceView( - _In_ HTREEITEM hParentItem - ); - - VOID EmptyDeviceView( - ); -}; -
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/Devices.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/Devices.cpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/Devices.cpp (removed) @@ -1,622 +0,0 @@ -/* -* PROJECT: ReactOS Device Manager -* LICENSE: GPL - See COPYING in the top level directory -* FILE: base/applications/mscutils/devmgmt/devices.cpp -* PURPOSE: Wrapper around setupapi functions -* COPYRIGHT: Copyright 2014 Ged Murphy gedmurphy@gmail.com -* -*/ - -#include "stdafx.h" -#include "devmgmt.h" -#include "Devices.h" - - -/* PUBLIC METHODS *****************************************/ - -CDevices::CDevices(void) : - m_bInitialized(FALSE), - m_RootImageIndex(-1) -{ - ZeroMemory(&m_ImageListData, sizeof(SP_CLASSIMAGELIST_DATA)); - - m_RootName[0] = UNICODE_NULL; -} - -CDevices::~CDevices(void) -{ - ATLASSERT(m_bInitialized == FALSE); -} - -BOOL -CDevices::Initialize() -{ - BOOL bSuccess; - - ATLASSERT(m_bInitialized == FALSE); - - /* Get the device image list */ - m_ImageListData.cbSize = sizeof(SP_CLASSIMAGELIST_DATA); - bSuccess = SetupDiGetClassImageList(&m_ImageListData); - if (bSuccess == FALSE) return FALSE; - - bSuccess = CreateRootDevice(); - if (bSuccess) m_bInitialized = TRUE; - - return m_bInitialized; -} - -BOOL -CDevices::Uninitialize() -{ - if (m_ImageListData.ImageList != NULL) - { - SetupDiDestroyClassImageList(&m_ImageListData); - ZeroMemory(&m_ImageListData, sizeof(SP_CLASSIMAGELIST_DATA)); - } - - m_bInitialized = FALSE; - - return TRUE; -} - -BOOL -CDevices::GetDeviceTreeRoot( - _Out_ LPWSTR RootName, - _In_ DWORD RootNameSize, - _Out_ PINT RootImageIndex - ) -{ - wcscpy_s(RootName, RootNameSize, m_RootName); - *RootImageIndex = m_RootImageIndex; - - return TRUE; -} - -BOOL -CDevices::GetChildDevice( - _In_ DEVINST ParentDevInst, - _Out_ PDEVINST DevInst - ) -{ - CONFIGRET cr; - - cr = CM_Get_Child(DevInst, - ParentDevInst, - 0); - return (cr == CR_SUCCESS); -} - -BOOL -CDevices::GetSiblingDevice( - _In_ DEVINST PrevDevice, - _Out_ PDEVINST DevInst - ) -{ - CONFIGRET cr; - - cr = CM_Get_Sibling(DevInst, - PrevDevice, - 0); - return (cr == CR_SUCCESS); -} - -BOOL -CDevices::GetDeviceStatus( - _In_ LPWSTR DeviceId, - _Out_ PULONG Status, - _Out_ PULONG ProblemNumber - ) -{ - DEVINST DeviceInstance; - CONFIGRET cr; - - *Status = 0; - *ProblemNumber = 0; - - /* Use the device id string to lookup the instance */ - cr = CM_Locate_DevNodeW(&DeviceInstance, - DeviceId, - CM_LOCATE_DEVNODE_NORMAL); - if (cr == CR_SUCCESS) - { - /* Get the status of this device */ - cr = CM_Get_DevNode_Status_Ex(Status, - ProblemNumber, - DeviceInstance, - 0, - NULL); - } - - return (cr == CR_SUCCESS) ? TRUE : FALSE; -} - -BOOL -CDevices::GetDevice( - _In_ DEVINST Device, - _Out_writes_(DeviceNameSize) LPWSTR DeviceName, - _In_ DWORD DeviceNameSize, - _Outptr_ LPWSTR *DeviceId, - _Out_ PINT ClassImage, - _Out_ PULONG Status, - _Out_ PULONG ProblemNumber - ) -{ - WCHAR ClassGuidString[MAX_GUID_STRING_LEN]; - GUID ClassGuid; - ULONG ulLength; - CONFIGRET cr; - BOOL bSuccess; - - *DeviceId = NULL; - - /* Get the length of the device id string */ - cr = CM_Get_Device_ID_Size(&ulLength, Device, 0); - if (cr == CR_SUCCESS) - { - /* We alloc heap here because this will be stored in the lParam of the TV */ - *DeviceId = (LPWSTR)HeapAlloc(GetProcessHeap(), - 0, - (ulLength + 1) * sizeof(WCHAR)); - if (*DeviceId) - { - /* Now get the actual device id */ - cr = CM_Get_Device_IDW(Device, - *DeviceId, - ulLength + 1, - 0); - if (cr != CR_SUCCESS) - { - HeapFree(GetProcessHeap(), 0, *DeviceId); - *DeviceId = NULL; - } - } - } - - /* Make sure we got the string */ - if (*DeviceId == NULL) - return FALSE; - - - /* Get the current status of the device */ - bSuccess = GetDeviceStatus(*DeviceId, Status, ProblemNumber); - if (bSuccess == FALSE) - { - HeapFree(GetProcessHeap(), 0, *DeviceId); - *DeviceId = NULL; - return FALSE; - } - - /* Get the class guid for this device */ - ulLength = MAX_GUID_STRING_LEN * sizeof(WCHAR); - cr = CM_Get_DevNode_Registry_PropertyW(Device, - CM_DRP_CLASSGUID, - NULL, - ClassGuidString, - &ulLength, - 0); - if (cr == CR_SUCCESS) - { - /* Convert the string to a proper guid */ - CLSIDFromString(ClassGuidString, &ClassGuid); - } - else - { - /* It's a device with no driver */ - ClassGuid = GUID_DEVCLASS_UNKNOWN; - } - - - /* Get the image for the class this device is in */ - SetupDiGetClassImageIndex(&m_ImageListData, - &ClassGuid, - ClassImage); - - /* Get the description for the device */ - ulLength = DeviceNameSize * sizeof(WCHAR); - cr = CM_Get_DevNode_Registry_PropertyW(Device, - CM_DRP_FRIENDLYNAME, - NULL, - DeviceName, - &ulLength, - 0); - if (cr != CR_SUCCESS) - { - ulLength = DeviceNameSize * sizeof(WCHAR); - cr = CM_Get_DevNode_Registry_PropertyW(Device, - CM_DRP_DEVICEDESC, - NULL, - DeviceName, - &ulLength, - 0); - - } - - /* Cleanup if something failed */ - if (cr != CR_SUCCESS) - { - HeapFree(GetProcessHeap(), 0, *DeviceId); - *DeviceId = NULL; - } - - return (cr == CR_SUCCESS ? TRUE : FALSE); -} - -BOOL -CDevices::EnumClasses( - _In_ ULONG ClassIndex, - _Out_writes_bytes_(sizeof(GUID)) LPGUID ClassGuid, - _Out_writes_(ClassNameSize) LPWSTR ClassName, - _In_ DWORD ClassNameSize, - _Out_writes_(ClassDescSize) LPWSTR ClassDesc, - _In_ DWORD ClassDescSize, - _Out_ PINT ClassImage - ) -{ - DWORD RequiredSize, Type, Size; - CONFIGRET cr; - DWORD Success; - HKEY hKey; - - ClassName[0] = UNICODE_NULL; - ClassDesc[0] = UNICODE_NULL; - *ClassImage = -1; - - /* Get the next class in the list */ - cr = CM_Enumerate_Classes(ClassIndex, - ClassGuid, - 0); - if (cr != CR_SUCCESS) return FALSE; - - /* Get the name of the device class */ - RequiredSize = MAX_CLASS_NAME_LEN; - (VOID)SetupDiClassNameFromGuidW(ClassGuid, - ClassName, - RequiredSize, - &RequiredSize); - - /* Open the registry key for this class */ - hKey = SetupDiOpenClassRegKeyExW(ClassGuid, - MAXIMUM_ALLOWED, - DIOCR_INSTALLER, - NULL, - 0); - if (hKey != INVALID_HANDLE_VALUE) - { - Size = ClassDescSize; - Type = REG_SZ; - - /* Lookup the class description (win7+) */ - Success = RegQueryValueExW(hKey, - L"ClassDesc", - NULL, - &Type, - (LPBYTE)ClassDesc, - &Size); - if (Success == ERROR_SUCCESS) - { - /* Check if the string starts with an @ */ - if (ClassDesc[0] == L'@') - { - /* The description is located in a module resource */ - Success = ConvertResourceDescriptorToString(ClassDesc, ClassDescSize); - } - } - else if (Success == ERROR_FILE_NOT_FOUND) - { - /* WinXP stores the description in the default value */ - Success = RegQueryValueExW(hKey, - NULL, - NULL, - &Type, - (LPBYTE)ClassDesc, - &Size); - } - - /* Close the registry key */ - RegCloseKey(hKey); - } - else - { - Success = GetLastError(); - } - - /* Check if we failed to get the class description */ - if (Success != ERROR_SUCCESS) - { - /* Use the class name as the description */ - wcscpy_s(ClassDesc, ClassDescSize, ClassName); - } - - /* Get the image index for this class */ - (VOID)SetupDiGetClassImageIndex(&m_ImageListData, - ClassGuid, - ClassImage); - - return TRUE; -} - -BOOL -CDevices::EnumDevicesForClass( - _Inout_opt_ LPHANDLE DeviceHandle, - _In_ LPCGUID ClassGuid, - _In_ DWORD Index, - _Out_ LPBOOL MoreItems, - _Out_ LPTSTR DeviceName, - _In_ DWORD DeviceNameSize, - _Outptr_ LPTSTR *DeviceId, - _Out_ PULONG Status, - _Out_ PULONG ProblemNumber - ) -{ - SP_DEVINFO_DATA DeviceInfoData; - DWORD DevIdSize; - HDEVINFO hDevInfo; - BOOL bUnknown, bSuccess; - - *MoreItems = FALSE; - *DeviceName = NULL; - *DeviceId = NULL; - bUnknown = FALSE; - - /* The unknown class is a special case */ - if (IsEqualGUID(*ClassGuid, GUID_DEVCLASS_UNKNOWN)) - bUnknown = TRUE; - - - /* Check if this is the first call for this class */ - if (*DeviceHandle == NULL) - { - ATLASSERT(Index == 0); - - /* Check for the special case */ - if (bUnknown == TRUE) - { - /* Get device info for all devices for all classes */ - hDevInfo = SetupDiGetClassDevsW(NULL, - NULL, - NULL, - DIGCF_ALLCLASSES); - if (hDevInfo == INVALID_HANDLE_VALUE) - return FALSE; - } - else - { - /* We only want the devices for this class */ - hDevInfo = SetupDiGetClassDevsW(ClassGuid, - NULL, - NULL, - DIGCF_PRESENT); - if (hDevInfo == INVALID_HANDLE_VALUE) - return FALSE; - } - - /* Store the handle for the next call */ - *DeviceHandle = (HANDLE)hDevInfo; - } - else - { - hDevInfo = (HDEVINFO)*DeviceHandle; - } - - - /* Get the device info for this device in the class */ - ZeroMemory(&DeviceInfoData, sizeof(SP_DEVINFO_DATA)); - DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA); - bSuccess = SetupDiEnumDeviceInfo(hDevInfo, - Index, - &DeviceInfoData); - if (bSuccess == FALSE) goto Quit; - - - - /* We found a device, let the caller know they might be more */ - *MoreItems = TRUE; - - /* Check if this is the unknown class */ - if (bUnknown) - { - /* We're looking for devices without guids */ - if (IsEqualGUID(DeviceInfoData.ClassGuid, GUID_NULL) == FALSE) - { - /* This is a known device, we aren't interested in it */ - return FALSE; - } - } - - /* Get the size required to hold the device id */ - bSuccess = SetupDiGetDeviceInstanceIdW(hDevInfo, - &DeviceInfoData, - NULL, - 0, - &DevIdSize); - if (bSuccess == FALSE && (GetLastError() != ERROR_INSUFFICIENT_BUFFER)) - goto Quit; - - /* Allocate some heap to hold the device string */ - *DeviceId = (LPTSTR)HeapAlloc(GetProcessHeap(), - 0, - DevIdSize * sizeof(WCHAR)); - if (*DeviceId == NULL) goto Quit; - - /* Now get the device id string */ - bSuccess = SetupDiGetDeviceInstanceIdW(hDevInfo, - &DeviceInfoData, - *DeviceId, - DevIdSize, - NULL); - if (bSuccess == FALSE) goto Quit; - - /* Skip the root device */ - if (*DeviceId != NULL && - wcscmp(*DeviceId, L"HTREE\ROOT\0") == 0) - { - bSuccess = FALSE; - goto Quit; - } - - - /* Get the current status of the device */ - bSuccess = GetDeviceStatus(*DeviceId, Status, ProblemNumber); - if (bSuccess == FALSE) goto Quit; - - - /* Get the device's friendly name */ - bSuccess = SetupDiGetDeviceRegistryPropertyW(hDevInfo, - &DeviceInfoData, - SPDRP_FRIENDLYNAME, - 0, - (BYTE*)DeviceName, - 256, - NULL); - if (bSuccess == FALSE) - { - /* if the friendly name fails, try the description instead */ - bSuccess = SetupDiGetDeviceRegistryPropertyW(hDevInfo, - &DeviceInfoData, - SPDRP_DEVICEDESC, - 0, - (BYTE*)DeviceName, - 256, - NULL); - } - - /* If we didn't find a name, check if this is an unknown device */ - if (bSuccess == FALSE && bUnknown == TRUE) - { - /* We add in our own text */ - wcscpy_s(DeviceName, 256, L"Unknown device"); - bSuccess = TRUE; - } - -Quit: - if (MoreItems == FALSE) - SetupDiDestroyDeviceInfoList(hDevInfo); - - if (bSuccess == FALSE) - { - if (*DeviceId) - { - HeapFree(GetProcessHeap(), 0, *DeviceId); - *DeviceId = NULL; - } - } - - return bSuccess; -} - - -/* PRIVATE METHODS ******************************************/ - -BOOL -CDevices::CreateRootDevice() -{ - HBITMAP hRootImage = NULL; - DWORD Size = ROOT_NAME_SIZE; - BOOL bSuccess = FALSE; - CONFIGRET cr; - - /* The root name is the computer name */ - (VOID)GetComputerNameW(m_RootName, &Size); - - /* Load the bitmap we'll be using as the root image */ - hRootImage = LoadBitmapW(g_hInstance, - MAKEINTRESOURCEW(IDB_ROOT_IMAGE)); - if (hRootImage == NULL) goto Cleanup; - - /* Add this bitmap to the device image list. This is a bit hacky, but it's safe */ - m_RootImageIndex = ImageList_Add(m_ImageListData.ImageList, - hRootImage, - NULL); - if (m_RootImageIndex == -1) - goto Cleanup; - - /* Get the root instance */ - cr = CM_Locate_DevNodeW(&m_RootDevInst, - NULL, - CM_LOCATE_DEVNODE_NORMAL); - if (cr == CR_SUCCESS) - bSuccess = TRUE; - -Cleanup: - if (bSuccess == FALSE) - { - SetupDiDestroyClassImageList(&m_ImageListData); - ZeroMemory(&m_ImageListData, sizeof(SP_CLASSIMAGELIST_DATA)); - } - - if (hRootImage) DeleteObject(hRootImage); - - return bSuccess; -} - -DWORD -CDevices::ConvertResourceDescriptorToString( - _Inout_z_ LPWSTR ResourceDescriptor, - _In_ DWORD ResourceDescriptorSize - ) -{ - WCHAR ModulePath[MAX_PATH]; - WCHAR ResString[256]; - INT ResourceId; - HMODULE hModule; - LPWSTR ptr; - DWORD Size; - DWORD dwError; - - - /* First check for a semi colon */ - ptr = wcschr(ResourceDescriptor, L';'); - if (ptr) - { - /* This must be an inf based descriptor, the desc is after the semi colon */ - wcscpy_s(ResourceDescriptor, ResourceDescriptorSize, ++ptr); - dwError = ERROR_SUCCESS; - } - else - { - /* This must be a dll resource based descriptor. Find the comma */ - ptr = wcschr(ResourceDescriptor, L','); - if (ptr == NULL) return ERROR_INVALID_DATA; - - /* Terminate the string where the comma was */ - *ptr = UNICODE_NULL; - - /* Expand any environment strings */ - Size = ExpandEnvironmentStringsW(&ResourceDescriptor[1], ModulePath, MAX_PATH); - if (Size > MAX_PATH) return ERROR_BUFFER_OVERFLOW; - if (Size == 0) return GetLastError(); - - /* Put the comma back and move past it */ - *ptr = L','; - ptr++; - - /* Load the dll */ - hModule = LoadLibraryExW(ModulePath, NULL, LOAD_LIBRARY_AS_DATAFILE); - if (hModule == NULL) return GetLastError(); - - /* Convert the resource id to a number */ - ResourceId = _wtoi(ptr); - - /* If the number is negative, make it positive */ - if (ResourceId < 0) ResourceId = -ResourceId; - - /* Load the string from the dll */ - if (LoadStringW(hModule, ResourceId, ResString, 256)) - { - wcscpy_s(ResourceDescriptor, ResourceDescriptorSize, ResString); - dwError = ERROR_SUCCESS; - } - else - { - dwError = GetLastError(); - } - - /* Free the library */ - FreeLibrary(hModule); - } - - return dwError; -} - -
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/Devices.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/Devices.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/Devices.h (removed) @@ -1,97 +0,0 @@ -#pragma once - -#define ROOT_NAME_SIZE MAX_COMPUTERNAME_LENGTH + 1 - -class CDevices -{ -private: - SP_CLASSIMAGELIST_DATA m_ImageListData; - BOOL m_bInitialized; - - DEVINST m_RootDevInst; - WCHAR m_RootName[ROOT_NAME_SIZE]; - INT m_RootImageIndex; - -public: - CDevices(void); - ~CDevices(void); - - BOOL Initialize( - ); - - BOOL Uninitialize( - ); - - BOOL GetDeviceTreeRoot( - _Out_ LPWSTR RootName, - _In_ DWORD RootNameSize, - _Out_ PINT RootImageIndex - ); - - BOOL GetChildDevice( - _In_ DEVINST ParentDevInst, - _Out_ PDEVINST DevInst - ); - - BOOL GetSiblingDevice( - _In_ DEVINST PrevDevice, - _Out_ PDEVINST DevInst - ); - - BOOL GetDevice( - _In_ DEVINST Device, - _Out_writes_(DeviceNameSize) LPTSTR DeviceName, - _In_ DWORD DeviceNameSize, - _Outptr_ LPTSTR *DeviceId, - _Out_ PINT ClassImage, - _Out_ PULONG Status, - _Out_ PULONG ProblemNumber - ); - - BOOL EnumClasses( - _In_ ULONG ClassIndex, - _Out_writes_bytes_(sizeof(GUID)) LPGUID ClassGuid, - _Out_writes_(ClassNameSize) LPWSTR ClassName, - _In_ DWORD ClassNameSize, - _Out_writes_(ClassDescSize) LPWSTR ClassDesc, - _In_ DWORD ClassDescSize, - _Out_ PINT ClassImage - ); - - BOOL EnumDevicesForClass( - _Inout_opt_ LPHANDLE DeviceHandle, - _In_ LPCGUID ClassGuid, - _In_ DWORD Index, - _Out_ LPBOOL MoreItems, - _Out_writes_(DeviceNameSize) LPTSTR DeviceName, - _In_ DWORD DeviceNameSize, - _Outptr_ LPTSTR *DeviceId, - _Out_ PULONG Status, - _Out_ PULONG ProblemNumber - ); - - BOOL GetDeviceStatus( - _In_ LPWSTR DeviceId, - _Out_ PULONG pulStatus, - _Out_ PULONG pulProblemNumber - ); - - - HIMAGELIST GetImageList() { return m_ImageListData.ImageList; } - DEVINST GetRootDevice() { return m_RootDevInst; } - -private: - BOOL CreateImageList( - ); - - BOOL CreateRootDevice( - ); - - DWORD ConvertResourceDescriptorToString( - _Inout_z_ LPWSTR ResourceDescriptor, - _In_ DWORD ResourceDescriptorSize - ); - - -}; -
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/MainWindow.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/MainWindow.cpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/MainWindow.cpp (removed) @@ -1,755 +0,0 @@ -/* -* PROJECT: ReactOS Device Manager -* LICENSE: GPL - See COPYING in the top level directory -* FILE: base/applications/mscutils/devmgmt/deviceview.cpp -* PURPOSE: Implements main window -* COPYRIGHT: Copyright 2014 Ged Murphy gedmurphy@gmail.com -* -*/ - -#include "stdafx.h" -#include "devmgmt.h" -#include "MainWindow.h" - - -/* DATA *****************************************************/ - -/* menu hints */ -static const MENU_HINT MainMenuHintTable[] = -{ - /* File Menu */ - {IDC_EXIT, IDS_HINT_EXIT}, - - /* Action Menu */ - {IDC_REFRESH, IDS_HINT_REFRESH}, - {IDC_PROP, IDS_HINT_PROP}, - - {IDC_ABOUT, IDS_HINT_ABOUT}, - - {IDC_DEVBYTYPE, IDS_HINT_DEV_BY_TYPE}, - {IDC_DEVBYCONN, IDS_HINT_DEV_BY_CONN}, - {IDC_RESBYTYPE, IDS_HINT_RES_BY_TYPE}, - {IDC_RESBYCONN, IDS_HINT_RES_BY_TYPE} - -}; - -/* system menu hints */ -static const MENU_HINT SystemMenuHintTable[] = -{ - {SC_RESTORE, IDS_HINT_SYS_RESTORE}, - {SC_MOVE, IDS_HINT_SYS_MOVE}, - {SC_SIZE, IDS_HINT_SYS_SIZE}, - {SC_MINIMIZE, IDS_HINT_SYS_MINIMIZE}, - {SC_MAXIMIZE, IDS_HINT_SYS_MAXIMIZE}, - {SC_CLOSE, IDS_HINT_SYS_CLOSE}, -}; - - -/* PUBLIC METHODS **********************************************/ - -CMainWindow::CMainWindow(void) : - m_ToolbarhImageList(NULL), - m_hMainWnd(NULL), - m_hStatusBar(NULL), - m_hToolBar(NULL), - m_CmdShow(0) -{ - m_szMainWndClass = L"DevMgmtWndClass"; -} - -CMainWindow::~CMainWindow(void) -{ - /* Destroy any previous list */ - if (m_ToolbarhImageList) ImageList_Destroy(m_ToolbarhImageList); -} - -BOOL -CMainWindow::Initialize(LPCTSTR lpCaption, - int nCmdShow) -{ - CAtlString szCaption; - WNDCLASSEXW wc = {0}; - - /* Store the show window value */ - m_CmdShow = nCmdShow; - - /* Setup the window class struct */ - wc.cbSize = sizeof(WNDCLASSEXW); - wc.lpfnWndProc = MainWndProc; - wc.hInstance = g_hInstance; - wc.hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCEW(IDI_MAIN_ICON)); - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); - wc.lpszMenuName = MAKEINTRESOURCEW(IDR_MAINMENU); - wc.lpszClassName = m_szMainWndClass; - wc.hIconSm = (HICON)LoadImage(g_hInstance, - MAKEINTRESOURCE(IDI_MAIN_ICON), - IMAGE_ICON, - 16, - 16, - LR_SHARED); - - /* Register the window */ - if (RegisterClassExW(&wc)) - { - /* Create the main window and store the info pointer */ - m_hMainWnd = CreateWindowExW(WS_EX_WINDOWEDGE, - m_szMainWndClass, - lpCaption, - WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, - CW_USEDEFAULT, - CW_USEDEFAULT, - 600, - 450, - NULL, - NULL, - g_hInstance, - this); - } - - /* Return creation result */ - return !!(m_hMainWnd); -} - -VOID -CMainWindow::Uninitialize() -{ - /* Unregister the window class */ - UnregisterClassW(m_szMainWndClass, g_hInstance); -} - -INT -CMainWindow::Run() -{ - MSG Msg; - - /* Pump the message queue */ - while (GetMessageW(&Msg, NULL, 0, 0 ) != 0) - { - TranslateMessage(&Msg); - DispatchMessageW(&Msg); - } - - return 0; -} - - -/* PRIVATE METHODS **********************************************/ - - -BOOL -CMainWindow::MainWndMenuHint(WORD CmdId, - const MENU_HINT *HintArray, - DWORD HintsCount, - UINT DefHintId) -{ - BOOL Found = FALSE; - const MENU_HINT *LastHint; - UINT HintId = DefHintId; - - LastHint = HintArray + HintsCount; - while (HintArray != LastHint) - { - if (HintArray->CmdId == CmdId) - { - HintId = HintArray->HintId; - Found = TRUE; - break; - } - HintArray++; - } - - StatusBarLoadString(m_hStatusBar, - SB_SIMPLEID, - g_hInstance, - HintId); - - return Found; -} - -BOOL -CMainWindow::UpdateDevicesDisplay(ListDevices List) -{ - UINT CheckId; - BOOL bSuccess; - - /* Set the new type*/ - m_DeviceView->SetDeviceListType(List); - - /* Get the menu item id */ - switch (List) - { - case DevicesByType: CheckId = IDC_DEVBYTYPE; break; - case DevicesByConnection: CheckId = IDC_DEVBYCONN; break; - case ResourcesByType: CheckId = IDC_RESBYTYPE; break; - case ResourcesByConnection: CheckId = IDC_RESBYCONN; break; - default: ATLASSERT(FALSE); break; - } - - /* Set the new check item */ - bSuccess = CheckMenuRadioItem(m_hMenu, - IDC_DEVBYTYPE, - IDC_RESBYCONN, - CheckId, - MF_BYCOMMAND); - - /* Refresh the view */ - m_DeviceView->Refresh(); - - return TRUE; -} - -BOOL -CMainWindow::CreateToolBar() -{ - HIMAGELIST hImageList; - HBITMAP hBitmap; - UINT StartResource, EndResource; - INT NumButtons; - BOOL bRet = FALSE; - - static TBBUTTON ToolbarButtons [] = - { - {TBICON_PROP, IDC_PROP, TBSTATE_INDETERMINATE, BTNS_BUTTON, {0}, 0, 0}, - {TBICON_REFRESH, IDC_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0}, - - /* Add a seperator: First item for a seperator is its width in pixels */ - {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, - }; - - /* Calculate the number of buttons */ - NumButtons = sizeof(ToolbarButtons) / sizeof(ToolbarButtons[0]); - - /* Create the toolbar window */ - m_hToolBar = CreateWindowExW(0, - TOOLBARCLASSNAME, - NULL, - WS_CHILD | WS_VISIBLE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, - 0, 0, 0, 0, - m_hMainWnd, - (HMENU)IDC_TOOLBAR, - g_hInstance, - NULL); - if (m_hToolBar == NULL) return FALSE; - - /* Don't show clipped buttons */ - SendMessageW(m_hToolBar, - TB_SETEXTENDEDSTYLE, - 0, - TBSTYLE_EX_HIDECLIPPEDBUTTONS); - - /* Set the struct size, the toobar needs this... */ - SendMessageW(m_hToolBar, - TB_BUTTONSTRUCTSIZE, - sizeof(ToolbarButtons[0]), - 0); - - /* Create the toolbar icon image list */ - m_ToolbarhImageList = ImageList_Create(16, - 16, - ILC_MASK | ILC_COLOR24, - NumButtons, - 0); - if (m_ToolbarhImageList == NULL) return FALSE; - - /* Set the index endpoints */ - StartResource = IDB_PROP; - EndResource = IDB_REFRESH; - - /* Add all icons to the image list */ - for (UINT i = StartResource; i <= EndResource; i++) - { - /* Load the image resource */ - hBitmap = (HBITMAP)LoadImage(g_hInstance, - MAKEINTRESOURCE(i), - IMAGE_BITMAP, - 16, - 16, - LR_LOADTRANSPARENT); - if (hBitmap) - { - /* Add it to the image list */ - ImageList_AddMasked(m_ToolbarhImageList, - hBitmap, - RGB(255, 0, 128)); - - /* Delete the bitmap */ - DeleteObject(hBitmap); - } - } - - /* Set the new image list */ - hImageList = (HIMAGELIST)SendMessageW(m_hToolBar, - TB_SETIMAGELIST, - 0, - (LPARAM)m_ToolbarhImageList); - - /* Destroy any previous list */ - if (hImageList) ImageList_Destroy(hImageList); - - /* Add the buttons */ - bRet = (BOOL)SendMessageW(m_hToolBar, - TB_ADDBUTTONS, - NumButtons, - (LPARAM)ToolbarButtons); - - return bRet; -} - -BOOL -CMainWindow::CreateStatusBar() -{ - INT StatWidths[] = {110, -1}; /* widths of status bar */ - BOOL bRet = FALSE; - - /* Create the status bar */ - m_hStatusBar = CreateWindowExW(0, - STATUSCLASSNAME, - NULL, - WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP, - 0, 0, 0, 0, - m_hMainWnd, - (HMENU)IDC_STATUSBAR, - g_hInstance, - NULL); - if (m_hStatusBar) - { - /* Set the width */ - bRet = (BOOL)SendMessageW(m_hStatusBar, - SB_SETPARTS, - sizeof(StatWidths) / sizeof(INT), - (LPARAM)StatWidths); - } - - return bRet; -} - -BOOL -CMainWindow::StatusBarLoadString(IN HWND hStatusBar, - IN INT PartId, - IN HINSTANCE hInstance, - IN UINT uID) -{ - CAtlString szMessage; - BOOL bRet = FALSE; - - /* Load the string */ - if (szMessage.LoadStringW(hInstance, uID)) - { - /* Send the message to the status bar */ - bRet = (BOOL)SendMessageW(hStatusBar, - SB_SETTEXT, - (WPARAM)PartId, - (LPARAM)szMessage.GetBuffer()); - } - - return bRet; -} - -LRESULT -CMainWindow::OnCreate(HWND hwnd) -{ - LRESULT RetCode; - - /* Assume failure */ - RetCode = -1; - - /* Store the window handle */ - m_hMainWnd = hwnd; - - /* Get the menu handle */ - m_hMenu = GetMenu(m_hMainWnd); - - /* Create the toolbar */ - if (CreateToolBar() && CreateStatusBar()) - { - /* Create the device view object */ - m_DeviceView = new CDeviceView(m_hMainWnd, DevicesByType); - - /* Initialize it */ - if (m_DeviceView->Initialize()) - { - UpdateDevicesDisplay(DevicesByType); - - /* Display the window according to the user request */ - ShowWindow(hwnd, m_CmdShow); - - /* Set as handled */ - RetCode = 0; - } - } - - return RetCode; -} - -LRESULT -CMainWindow::OnSize() -{ - RECT rcClient, rcTool, rcStatus; - INT lvHeight, iToolHeight, iStatusHeight; - - /* Autosize the toolbar */ - SendMessage(m_hToolBar, TB_AUTOSIZE, 0, 0); - - /* Get the toolbar rect and save the height */ - GetWindowRect(m_hToolBar, &rcTool); - iToolHeight = rcTool.bottom - rcTool.top; - - /* Resize the status bar */ - SendMessage(m_hStatusBar, WM_SIZE, 0, 0); - - /* Get the statusbar rect and save the height */ - GetWindowRect(m_hStatusBar, &rcStatus); - iStatusHeight = rcStatus.bottom - rcStatus.top; - - /* Get the full client rect */ - GetClientRect(m_hMainWnd, &rcClient); - - /* Calculate the remaining height for the treeview */ - lvHeight = rcClient.bottom - iToolHeight - iStatusHeight; - - /* Resize the device view */ - m_DeviceView->Size(0, - iToolHeight, - rcClient.right, - lvHeight); - - return 0; -} - -LRESULT -CMainWindow::OnNotify(LPARAM lParam) -{ - LPNMHDR NmHdr = (LPNMHDR)lParam; - - switch (NmHdr->code) - { - case TVN_DELETEITEMW: - { - LPNMTREEVIEW NmTreeView = (LPNMTREEVIEW)lParam; - - NmTreeView->action = NmTreeView->action; - - break; - } - - case TVN_SELCHANGED: - { - LPNM_TREEVIEW pnmtv = (LPNM_TREEVIEW)lParam; - ListDevices ListType = m_DeviceView->GetDeviceListType(); - - if (ListType == DevicesByType) - { - if (!m_DeviceView->HasChildItem(pnmtv->itemNew.hItem)) - { - SendMessage(m_hToolBar, - TB_SETSTATE, - IDC_PROP, - (LPARAM)MAKELONG(TBSTATE_ENABLED, 0)); - - EnableMenuItem(GetMenu(m_hMainWnd), IDC_PROP, MF_ENABLED); - m_DeviceView->EnableContextMenuItem(IDC_PROP, MF_ENABLED); - } - else - { - SendMessage(m_hToolBar, - TB_SETSTATE, - IDC_PROP, - (LPARAM)MAKELONG(TBSTATE_INDETERMINATE, 0)); - - EnableMenuItem(GetMenu(m_hMainWnd), IDC_PROP, MF_GRAYED); - m_DeviceView->EnableContextMenuItem(IDC_PROP, MF_GRAYED); - } - } - else if (ListType == DevicesByConnection) - { - if (m_DeviceView->IsRootItem(pnmtv->itemNew.hItem)) - { - SendMessage(m_hToolBar, - TB_SETSTATE, - IDC_PROP, - (LPARAM)MAKELONG(TBSTATE_INDETERMINATE, 0)); - - EnableMenuItem(GetMenu(m_hMainWnd), IDC_PROP, MF_GRAYED); - m_DeviceView->EnableContextMenuItem(IDC_PROP, MF_GRAYED); - } - else - { - SendMessage(m_hToolBar, - TB_SETSTATE, - IDC_PROP, - (LPARAM)MAKELONG(TBSTATE_ENABLED, 0)); - - EnableMenuItem(GetMenu(m_hMainWnd), IDC_PROP, MF_ENABLED); - m_DeviceView->EnableContextMenuItem(IDC_PROP, MF_ENABLED); - } - } - } - break; - - case NM_DBLCLK: - { - m_DeviceView->DisplayPropertySheet(); - break; - } - - case NM_RETURN: - { - ListDevices ListType = m_DeviceView->GetDeviceListType(); - if (ListType == DevicesByType) - { - m_DeviceView->DisplayPropertySheet(); - } - else if (ListType == DevicesByConnection) - { - if (!m_DeviceView->IsRootItemSelected()) - { - m_DeviceView->DisplayPropertySheet(); - } - } - break; - } - } - - return 0; -} - -LRESULT -CMainWindow::OnContext(LPARAM lParam) -{ - INT xPos = GET_X_LPARAM(lParam); - INT yPos = GET_Y_LPARAM(lParam); - - m_DeviceView->ShowContextMenu(xPos, yPos); - return 0; -} - -LRESULT -CMainWindow::OnCommand(WPARAM wParam, - LPARAM lParam) -{ - LRESULT RetCode = 0; - WORD Msg; - - /* Get the message */ - Msg = LOWORD(wParam); - - switch (Msg) - { - case IDC_PROP: - { - /* Display the device property sheet */ - m_DeviceView->DisplayPropertySheet(); - break; - } - - case IDC_REFRESH: - { - /* Refresh the device list */ - m_DeviceView->Refresh(); - break; - } - - case IDC_DEVBYTYPE: - { - UpdateDevicesDisplay(DevicesByType); - break; - } - - case IDC_DEVBYCONN: - { - UpdateDevicesDisplay(DevicesByConnection); - break; - } - - case IDC_SHOWHIDDEN: - { - UINT CurCheckState, NewCheckState; - - /* Get the current state */ - CurCheckState = GetMenuState(m_hMenu, IDC_SHOWHIDDEN, MF_BYCOMMAND); - - /* Inform the device view of the change */ - if (CurCheckState == MF_CHECKED) - { - NewCheckState = MF_UNCHECKED; - m_DeviceView->ShowHiddenDevices(FALSE); - } - else if (CurCheckState == MF_UNCHECKED) - { - NewCheckState = MF_CHECKED; - m_DeviceView->ShowHiddenDevices(TRUE); - } - else - { - ATLASSERT(FALSE); - break; - } - - /* Set the new check state */ - CheckMenuItem(m_hMenu, IDC_SHOWHIDDEN, MF_BYCOMMAND | NewCheckState); - - /* Refresh the device view */ - m_DeviceView->Refresh(); - break; - } - - case IDC_ABOUT: - { - /* Apportion blame */ - MessageBoxW(m_hMainWnd, - L"ReactOS Device Manager\r\nCopyright Ged Murphy 2014", - L"About", - MB_OK | MB_APPLMODAL); - - /* Set focus back to the treeview */ - m_DeviceView->SetFocus(); - break; - } - - case IDC_EXIT: - { - /* Post a close message to the window */ - PostMessageW(m_hMainWnd, - WM_CLOSE, - 0, - 0); - break; - } - - default: - break; - } - - return RetCode; -} - -LRESULT -CMainWindow::OnDestroy() -{ - /* Uninitialize the device view */ - m_DeviceView->Uninitialize(); - - /* Kill the object */ - delete m_DeviceView; - m_DeviceView = NULL; - - /* Clear the user data pointer */ - SetWindowLongPtr(m_hMainWnd, GWLP_USERDATA, 0); - - /* Break the message loop */ - PostQuitMessage(0); - - return 0; -} - -LRESULT CALLBACK -CMainWindow::MainWndProc(HWND hwnd, - UINT msg, - WPARAM wParam, - LPARAM lParam) -{ - CMainWindow *pThis; - LRESULT RetCode = 0; - - /* Get the object pointer from window context */ - pThis = (CMainWindow *)GetWindowLongPtr(hwnd, GWLP_USERDATA); - - /* Check for an invalid pointer */ - if (pThis == NULL) - { - /* Check that this isn't a create message */ - if (msg != WM_CREATE) - { - /* Don't handle null info pointer */ - goto HandleDefaultMessage; - } - } - - switch(msg) - { - case WM_CREATE: - { - /* Get the object pointer from the create param */ - pThis = (CMainWindow *)((LPCREATESTRUCT)lParam)->lpCreateParams; - - /* Store the info pointer in the window's global user data */ - SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pThis); - - /* Call the create handler */ - RetCode = pThis->OnCreate(hwnd); - break; - } - - case WM_SIZE: - { - RetCode = pThis->OnSize(); - break; - } - - case WM_NOTIFY: - { - /* Handle the notify message */ - RetCode = pThis->OnNotify(lParam); - break; - } - - case WM_CONTEXTMENU: - { - /* Handle creating the context menu */ - RetCode = pThis->OnContext(lParam); - break; - } - - case WM_MENUSELECT: - { - if (pThis->m_hStatusBar != NULL) - { - if (!pThis->MainWndMenuHint(LOWORD(wParam), - MainMenuHintTable, - sizeof(MainMenuHintTable) / sizeof(MainMenuHintTable[0]), - IDS_HINT_BLANK)) - { - pThis->MainWndMenuHint(LOWORD(wParam), - SystemMenuHintTable, - sizeof(SystemMenuHintTable) / sizeof(SystemMenuHintTable[0]), - IDS_HINT_BLANK); - } - } - - break; - } - - case WM_COMMAND: - { - /* Handle the command message */ - RetCode = pThis->OnCommand(wParam, lParam); - - /* Hand it off to the default message handler */ - goto HandleDefaultMessage; - } - - case WM_CLOSE: - { - /* Destroy the main window */ - DestroyWindow(hwnd); - } - break; - - case WM_DESTROY: - { - /* Call the destroy handler */ - RetCode = pThis->OnDestroy(); - break; - } - - default: - { -HandleDefaultMessage: - RetCode = DefWindowProc(hwnd, msg, wParam, lParam); - break; - } - } - - return RetCode; -}
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/MainWindow.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/MainWindow.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/MainWindow.h (removed) @@ -1,65 +0,0 @@ -#pragma once -#include "DeviceView.h" - -typedef struct _MENU_HINT -{ - WORD CmdId; - UINT HintId; -} MENU_HINT, *PMENU_HINT; - -class CMainWindow -{ - CAtlString m_szMainWndClass; - CDeviceView *m_DeviceView; - HWND m_hMainWnd; - HWND m_hStatusBar; - HWND m_hToolBar; - HIMAGELIST m_ToolbarhImageList; - HMENU m_hMenu; - int m_CmdShow; - -public: - CMainWindow(void); - ~CMainWindow(void); - - BOOL Initialize(LPCTSTR lpCaption, int nCmdShow); - INT Run(); - VOID Uninitialize(); - -private: - static LRESULT CALLBACK MainWndProc( - HWND hwnd, - UINT msg, - WPARAM wParam, - LPARAM lParam - ); - - LRESULT OnCreate(HWND hwnd); - LRESULT OnDestroy(); - LRESULT OnSize(); - LRESULT OnNotify(LPARAM lParam); - LRESULT OnContext(LPARAM lParam); - LRESULT OnCommand(WPARAM wParam, LPARAM lParam); - - BOOL CreateToolBar(); - BOOL CreateStatusBar(); - - BOOL StatusBarLoadString( - HWND hStatusBar, - INT PartId, - HINSTANCE hInstance, - UINT uID - ); - - BOOL MainWndMenuHint( - WORD CmdId, - const MENU_HINT *HintArray, - DWORD HintsCount, - UINT DefHintId - ); - - BOOL UpdateDevicesDisplay( - ListDevices List - ); -}; -
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/Resource.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/Resource.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/Resource.h (removed) @@ -1,68 +0,0 @@ -#define IDC_STATIC -1 - -#define IDI_MAIN_ICON 50 -#define IDB_ROOT_IMAGE 51 - -/* windows */ -#define IDC_TREEVIEW 1000 -#define IDC_TOOLBAR 1001 -#define IDC_STATUSBAR 1002 - -/* commands */ -#define IDC_PROP 2000 -#define IDC_REFRESH 2001 -#define IDC_PRINT 2002 -#define IDC_EXIT 2003 -#define IDC_ABOUT 4031 - -/* menus */ -#define IDR_MAINMENU 102 -#define IDR_POPUP 103 -#define IDC_DEVBYTYPE 104 -#define IDC_DEVBYCONN 105 -#define IDC_RESBYTYPE 106 -#define IDC_RESBYCONN 107 -#define IDC_SHOWHIDDEN 108 - -/* tooltips */ -#define IDS_TOOLTIP_PROP 6000 -#define IDS_TOOLTIP_REFRESH 6001 -#define IDS_TOOLTIP_HELP 6002 - -/* button bitmaps */ -#define IDB_PROP 10000 -#define IDB_REFRESH 10001 - -/* toolbar buttons */ -#define TBICON_PROP 0 -#define TBICON_REFRESH 1 -#define TBICON_HELP 2 - -/* about box info */ -#define IDD_ABOUTBOX 200 -#define IDC_LICENSE_EDIT 201 -#define IDS_APPNAME 202 -#define IDS_LICENSE 203 - - -/* menu hints */ -#define IDS_HINT_BLANK 20000 -#define IDS_HINT_REFRESH 20002 -#define IDS_HINT_PROP 20003 -#define IDS_HINT_HELP 20004 -#define IDS_HINT_ABOUT 20005 -#define IDS_HINT_EXIT 20006 - -#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 - -/* 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/base/applications/mscutils/devmgmt_new/devmgmt.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt.cpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt.cpp [iso-8859-1] Tue Jun 16 12:22:14 2015 @@ -1,9 +1,7 @@ -#include "stdafx.h" -#include "devmgmt.h" -#include "MainWindow.h" - -HINSTANCE g_hInstance = NULL; -HANDLE ProcessHeap = NULL; +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <cfgmgr32.h> +#include <dll\devmgr\devmgr.h>
int WINAPI wWinMain(HINSTANCE hThisInstance, @@ -11,47 +9,13 @@ LPWSTR lpCmdLine, int nCmdShow) { - CMainWindow MainWindow; - INITCOMMONCONTROLSEX icex; - HANDLE hMutex; - CAtlString szAppName; - - int Ret = 1; - - /* Check if the app is already running */ - hMutex = CreateMutexW(NULL, TRUE, L"devmgmt_mutex2"); - if (hMutex == NULL || GetLastError() == ERROR_ALREADY_EXISTS) + if (!DeviceManager_ExecuteW(NULL, + hThisInstance, + NULL, + nCmdShow)) { - /* Cleanup and exit */ - //if (hMutex) CloseHandle(hMutex); - //return 0; + return GetLastError(); }
- /* Store the global values */ - g_hInstance = hThisInstance; - ProcessHeap = GetProcessHeap(); - - /* Initialize common controls */ - icex.dwSize = sizeof(INITCOMMONCONTROLSEX); - icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES; - InitCommonControlsEx(&icex); - - /* Load the application name */ - if (szAppName.LoadStringW(g_hInstance, IDS_APPNAME)) - { - /* Initialize the main window */ - if (MainWindow.Initialize(szAppName, nCmdShow)) - { - /* Run the application */ - Ret = MainWindow.Run(); - - /* Uninitialize the main window */ - MainWindow.Uninitialize(); - } - } - - /* Delete the app mutex */ - CloseHandle(hMutex); - - return Ret; + return 0; }
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt.exe.manifest URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt.exe.manifest [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt.exe.manifest (removed) @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly - xmlns="urn:schemas-microsoft-com:asm.v1" - manifestVersion="1.0"> -<assemblyIdentity - name="ReactOS.Apps.devmgmt" - processorArchitecture="*" - version="1.0.0.0" - type="win32"/> -<description>ReactOS Device Manager</description> -<dependency> - <dependentAssembly> - <assemblyIdentity - type="win32" - name="Microsoft.Windows.Common-Controls" - version="6.0.0.0" - processorArchitecture="*" - publicKeyToken="6595b64144ccf1df" - language="*" - /> - </dependentAssembly> -</dependency> -</assembly> -
Modified: trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt.h [iso-8859-1] Tue Jun 16 12:22:14 2015 @@ -1,9 +1 @@ #pragma once -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#pragma once -#include "resource.h" - -extern HINSTANCE g_hInstance; -extern HANDLE ProcessHeap; -
Modified: trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== Binary files - no diff available.
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt_new.sln URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt_new.sln [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt_new.sln (removed) @@ -1,24 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30501.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "devmgmt_new", "devmgmt_new.vcxproj", "{47B3358F-E7C3-4D02-9310-68813B9292E0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {47B3358F-E7C3-4D02-9310-68813B9292E0}.Debug|Win32.ActiveCfg = Debug|Win32 - {47B3358F-E7C3-4D02-9310-68813B9292E0}.Debug|Win32.Build.0 = Debug|Win32 - {47B3358F-E7C3-4D02-9310-68813B9292E0}.Debug|Win32.Deploy.0 = Debug|Win32 - {47B3358F-E7C3-4D02-9310-68813B9292E0}.Release|Win32.ActiveCfg = Release|Win32 - {47B3358F-E7C3-4D02-9310-68813B9292E0}.Release|Win32.Build.0 = Release|Win32 - {47B3358F-E7C3-4D02-9310-68813B9292E0}.Release|Win32.Deploy.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt_new.vcxproj URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt_new.vcxproj [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt_new.vcxproj (removed) @@ -1,106 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{47B3358F-E7C3-4D02-9310-68813B9292E0}</ProjectGuid> - <Keyword>Win32Proj</Keyword> - <RootNamespace>devmgmt_new</RootNamespace> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v120_xp</PlatformToolset> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v120_xp</PlatformToolset> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <LinkIncremental>true</LinkIncremental> - <GenerateManifest>false</GenerateManifest> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <LinkIncremental>false</LinkIncremental> - <GenerateManifest>false</GenerateManifest> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <WarningLevel>Level3</WarningLevel> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <AdditionalDependencies>UxTheme.lib;comctl32.lib;setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies> - </Link> - <ResourceCompile> - <PreprocessorDefinitions>LANGUAGE_EN_US;%(PreprocessorDefinitions)</PreprocessorDefinitions> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - <AdditionalDependencies>UxTheme.lib;comctl32.lib;setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="Devices.cpp" /> - <ClCompile Include="DeviceView.cpp" /> - <ClCompile Include="devmgmt.cpp" /> - <ClCompile Include="MainWindow.cpp" /> - <ClCompile Include="stdafx.cpp" /> - </ItemGroup> - <ItemGroup> - <ClInclude Include="Devices.h" /> - <ClInclude Include="DeviceView.h" /> - <ClInclude Include="devmgmt.h" /> - <ClInclude Include="MainWindow.h" /> - <ClInclude Include="Resource.h" /> - <ClInclude Include="stdafx.h" /> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="devmgmt.rc" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project>
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt_new.vcxproj.filters URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt_new.vcxproj.filters [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/devmgmt_new.vcxproj.filters (removed) @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> - <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> - </Filter> - <Filter Include="Header Files"> - <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - </Filter> - <Filter Include="Resource Files"> - <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="Devices.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="DeviceView.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="devmgmt.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="MainWindow.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="stdafx.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="Devices.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="DeviceView.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="devmgmt.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="MainWindow.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="Resource.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="stdafx.h"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="devmgmt.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - </ItemGroup> -</Project>
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/precomp.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/precomp.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/precomp.h (removed) @@ -1,29 +0,0 @@ -#pragma once - -#include <stdio.h> -#include <tchar.h> - -#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define COBJMACROS - -#include <windows.h> -#include <windowsx.h> - -#include <setupapi.h> -#include <cfgmgr32.h> -#include <commctrl.h> -#include <uxtheme.h> -#include <cfgmgr32.h> -#include <devguid.h> - -#include <atlbase.h> - -#include <strsafe.h> - -#include "resource.h" - -extern HINSTANCE g_hInstance; -extern HANDLE ProcessHeap;
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/rsrc.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/rsrc.rc (removed) @@ -1,83 +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_PROP BITMAP DISCARDABLE "res/properties.bmp" -IDB_REFRESH BITMAP DISCARDABLE "res/refresh.bmp" -IDB_HELP BITMAP DISCARDABLE "res/help.bmp" -IDB_EXIT BITMAP DISCARDABLE "res/exit.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
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/stdafx.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/stdafx.cpp [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/stdafx.cpp (removed) @@ -1 +0,0 @@ -#include "stdafx.h"
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/stdafx.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/stdafx.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/stdafx.h (removed) @@ -1,16 +0,0 @@ -#pragma once - -#define WIN32_LEAN_AND_MEAN -#include <Windows.h> -#include <windowsx.h> -#include <setupapi.h> -#include <cfgmgr32.h> -#include <commctrl.h> -#include <Uxtheme.h> -#include <Cfgmgr32.h> -#include <devguid.h> - -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit - -#include <atlbase.h> -#include <atlstr.h>
Removed: trunk/reactos/base/applications/mscutils/devmgmt_new/targetver.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/devmgmt_new/targetver.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/devmgmt_new/targetver.h (removed) @@ -1,8 +0,0 @@ -#pragma once - -// Including SDKDDKVer.h defines the highest available Windows platform. - -// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and -// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. - -#include <SDKDDKVer.h>