- last few fixes to the device manager code to get it building with rosbe (msvc)
- Next steps are to merge it with the existing devmgr code (mostly done in my WC) and get it running via mmc.exe & devmgmt.msc
svn path=/trunk/; revision=68367
if (ptr)
{
// This must be an inf based descriptor, the desc is after the semi colon
- wcscpy_s(ResourceDescriptor, ResourceDescriptorSize, ++ptr);
+ StringCbCopyW(ResourceDescriptor, ResourceDescriptorSize, ++ptr);
dwError = ERROR_SUCCESS;
}
else
// Load the string from the dll
if (LoadStringW(hModule, ResourceId, ResString, 256))
{
- wcscpy_s(ResourceDescriptor, ResourceDescriptorSize, ResString);
+ StringCbCopyW(ResourceDescriptor, ResourceDescriptorSize, ResString);
dwError = ERROR_SUCCESS;
}
else
_Out_ bool &NeedsReboot
)
{
- bool Ret = false;
bool Canceled = false;
SetFlags(DI_NODI_DEFAULTACTION, 0);
NULL,
0);
+ return true;
+
}
/* PRIVATE METHODS ******************************************************/
{
DevInstallParams.Flags |= Flags;
DevInstallParams.FlagsEx |= FlagsEx;
- return SetupDiSetDeviceInstallParamsW(m_hDevInfo,
- &m_DevinfoData,
- &DevInstallParams);
+ return (SetupDiSetDeviceInstallParamsW(m_hDevInfo,
+ &m_DevinfoData,
+ &DevInstallParams) != 0);
}
return false;
}
{
DevInstallParams.Flags &= ~Flags;
DevInstallParams.FlagsEx &= ~FlagsEx;
- return SetupDiSetDeviceInstallParamsW(m_hDevInfo,
- &m_DevinfoData,
- &DevInstallParams);
+ return (SetupDiSetDeviceInstallParamsW(m_hDevInfo,
+ &m_DevinfoData,
+ &DevInstallParams) != 0);
}
return false;
}
#define CLASS_DESC_LEN 256
#define ROOT_NAME_SIZE MAX_COMPUTERNAME_LENGTH + 1
+extern "C" {
INT_PTR
WINAPI
DevicePropertiesExW(
IN DWORD dwFlags OPTIONAL,
IN BOOL bShowDevMgr
);
-
+}
typedef INT_PTR(WINAPI *pDevicePropertiesExW)(HWND,LPCWSTR,LPCWSTR,DWORD,BOOL);
struct RefreshThreadData
// Node gets deleted on refresh so we copy it to another block
size_t Length = wcslen(DeviceId) + 1;
ThreadData->DeviceId = new WCHAR[Length];
- wcscpy_s(ThreadData->DeviceId, Length, DeviceId);
+ StringCbCopyW(ThreadData->DeviceId, Length, DeviceId);
}
HTREEITEM hTreeItem = NULL;
GUID ClassGuid;
INT ClassIndex;
- LPTSTR DeviceId = NULL;
BOOL bClassSuccess, bSuccess;
// Start by adding the root node to the tree
bool bClassUnknown = false;
bool AddedParent = false;
INT DeviceIndex = 0;
- BOOL MoreItems;
+ bool MoreItems = false;
// Get the cached class node
ClassNode = GetClassNode(&ClassGuid);
DeviceIndex,
&DeviceInfoData);
if (bSuccess == FALSE && GetLastError() == ERROR_NO_MORE_ITEMS)
- MoreItems = FALSE;
+ MoreItems = false;
if (bSuccess)
{
- MoreItems = TRUE;
+ MoreItems = true;
// The unknown class handle contains all devices on the system,
// and we're just looking for the ones with a null GUID
bool
CMainWindow::RefreshView(ViewType Type)
{
- UINT CheckId;
+ UINT CheckId = 0;
BOOL bSuccess;
// Refreshed the cached view
return bRet;
}
-void CMainWindow::UpdateToolbar(_In_ LPTV_ITEMW TvItem)
+void CMainWindow::UpdateToolbar()
{
WORD State;
{
case TVN_SELCHANGED:
{
- LPNMTREEVIEW NmTreeView = (LPNMTREEVIEW)lParam;
- UpdateToolbar(&NmTreeView->itemNew);
+ UpdateToolbar();
break;
}
case NM_DBLCLK:
{
- LPNMTREEVIEW NmTreeView = (LPNMTREEVIEW)lParam;
m_DeviceView->DisplayPropertySheet();
break;
}
LRESULT
CMainWindow::OnCommand(WPARAM wParam,
- LPARAM lParam)
+ LPARAM /*lParam*/)
{
LRESULT RetCode = 0;
WORD Msg;
BOOL
WINAPI
-DeviceManager_ExecuteW(HWND hWndParent,
+DeviceManager_ExecuteW(HWND /*hWndParent*/,
HINSTANCE hInst,
- LPCWSTR lpMachineName,
+ LPCWSTR /*lpMachineName*/,
int nCmdShow)
{
CMainWindow MainWindow;
bool CreateStatusBar();
void UpdateToolbar(
- _In_ LPTV_ITEMW TvItem
);
bool StatusBarLoadString(
* PROJECT: ReactOS Device Manager
* LICENSE: GPL - See COPYING in the top level directory
* FILE: dll/win32/devmgr/devmgr/node.cpp
-* PURPOSE: Object for each device in the tree
+* PURPOSE: Abstract base object for each node in the tree
* COPYRIGHT: Copyright 2015 Ged Murphy <gedmurphy@reactos.org>
*
*/
LPWSTR GetDisplayName() { return m_DisplayName; }
INT GetClassImage() { return m_ClassImage; }
LPWSTR GetDeviceId() { return m_DeviceId; }
-
bool HasProperties() { return (m_DeviceId != NULL); }
-
-private:
- void Cleanup();
-
};
// The root name is the computer name
DWORD Size = DISPLAY_NAME_LEN;
if (GetComputerNameW(m_DisplayName, &Size))
- _wcslwr_s(m_DisplayName);
+ _wcslwr(m_DisplayName);
return true;
#pragma once
-#ifndef __REACTOS___
+#ifndef __REACTOS__
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <devguid.h>
#include <process.h>
+
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#include <tchar.h>
#include <atlbase.h>
#include <atlstr.h>
#include <atlcoll.h>
+#include <strsafe.h>
#else
-#include <tchar.h>
+#include <string.h>
+#include <wchar.h>
+#include <tchar.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <shlwapi.h>
#include <strsafe.h>
#include <process.h>
-
-#include <string.h>
-#include <wchar.h>
+#include <WindowsX.h>
+#include <strsafe.h>
#include <setupapi.h>
#include <commctrl.h>
#include <cfgmgr32.h>
#include <Uxtheme.h>
+#include <devguid.h>
#include <atlbase.h>
-#include <atlcom.h>
-#include <atlwin.h>
#include <atlstr.h>
+#include <atlcoll.h>
#endif
\ No newline at end of file