mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
[DEVMGR]
- Build the properties as C++ - Rearrange the folder structure - The whole thing now builds and runs from VS (with a few hacks). CMake next svn path=/trunk/; revision=69320
This commit is contained in:
parent
0ea9ff44f2
commit
e82b2a4870
15 changed files with 415 additions and 379 deletions
|
@ -3,16 +3,17 @@ spec2def(devmgr.dll devmgr.spec ADD_IMPORTLIB)
|
|||
|
||||
set_cpp(WITH_RTTI WITH_RUNTIME)
|
||||
|
||||
include_directories(${REACTOS_SOURCE_DIR}/lib/atl)
|
||||
include_directories(${REACTOS_SOURCE_DIR}/lib/atl includes devmgmt)
|
||||
|
||||
list(APPEND SOURCE
|
||||
precomp.h
|
||||
properties/advprop.c
|
||||
properties/devprblm.c
|
||||
properties/hwpage.c
|
||||
properties/hwresource.c
|
||||
properties/misc.c
|
||||
properties/stubs.c
|
||||
stdafx.h
|
||||
api.cpp
|
||||
properties/advprop.cpp
|
||||
properties/devprblm.cpp
|
||||
properties/hwpage.cpp
|
||||
properties/hwresource.cpp
|
||||
properties/misc.cpp
|
||||
properties/stubs.cpp
|
||||
devmgmt/ClassNode.cpp
|
||||
devmgmt/DeviceNode.cpp
|
||||
devmgmt/DeviceView.cpp
|
||||
|
|
262
reactos/dll/win32/devmgr_new/api.cpp
Normal file
262
reactos/dll/win32/devmgr_new/api.cpp
Normal file
|
@ -0,0 +1,262 @@
|
|||
/*
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS devmgr.dll
|
||||
* FILE: lib/devmgr/stubs.c
|
||||
* PURPOSE: devmgr.dll stubs
|
||||
* PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
|
||||
* Ged Murphy (gedmurphy@reactos.org)
|
||||
* NOTES:
|
||||
* Some helpful resources:
|
||||
* http://support.microsoft.com/default.aspx?scid=kb;%5BLN%5D;815320
|
||||
* http://www.jsiinc.com/SUBO/tip7400/rh7482.htm
|
||||
* http://www.jsiinc.com/SUBM/tip6400/rh6490.htm
|
||||
*
|
||||
* UPDATE HISTORY:
|
||||
* 04-04-2004 Created
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "devmgmt\MainWindow.h"
|
||||
|
||||
#define UNIMPLEMENTED
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* NAME EXPORTED
|
||||
* DeviceManager_ExecuteA
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Starts the Device Manager
|
||||
*
|
||||
* ARGUMENTS
|
||||
* hWndParent: Handle to the parent window
|
||||
* hInst: Handle to the application instance
|
||||
* lpMachineName: Machine Name, NULL is the local machine
|
||||
* nCmdShow: Specifies how the window should be shown
|
||||
*
|
||||
* RETURN VALUE
|
||||
* TRUE: if no errors occured
|
||||
* FALSE: if the device manager could not be executed
|
||||
*
|
||||
* REVISIONS
|
||||
*
|
||||
* NOTE
|
||||
* - Win runs the device manager in a separate process, so hWndParent is somehow
|
||||
* obsolete.
|
||||
*
|
||||
* @unimplemented
|
||||
*/
|
||||
BOOL
|
||||
WINAPI
|
||||
DeviceManager_ExecuteA(HWND hWndParent,
|
||||
HINSTANCE hInst,
|
||||
LPCSTR lpMachineName,
|
||||
int nCmdShow)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* NAME EXPORTED
|
||||
* DeviceManager_ExecuteW
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Starts the Device Manager
|
||||
*
|
||||
* ARGUMENTS
|
||||
* hWndParent: Handle to the parent window
|
||||
* hInst: Handle to the application instance
|
||||
* lpMachineName: Machine Name, NULL is the local machine
|
||||
* nCmdShow: Specifies how the window should be shown
|
||||
*
|
||||
* RETURN VALUE
|
||||
* TRUE: if no errors occured
|
||||
* FALSE: if the device manager could not be executed
|
||||
*
|
||||
* REVISIONS
|
||||
*
|
||||
* NOTE
|
||||
* - Win runs the device manager in a separate process, so hWndParent is somehow
|
||||
* obsolete.
|
||||
*
|
||||
* @unimplemented
|
||||
*/
|
||||
BOOL
|
||||
WINAPI
|
||||
DeviceManager_ExecuteW(HWND hWndParent,
|
||||
HINSTANCE hInst,
|
||||
LPCWSTR lpMachineName,
|
||||
int nCmdShow)
|
||||
{
|
||||
//
|
||||
// This needs to create the mmc process which will load the device manager in-proc
|
||||
CDeviceManager DevMgr;
|
||||
return DevMgr.Create(hWndParent, hInst, lpMachineName, nCmdShow);
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* NAME EXPORTED
|
||||
* DeviceProblemWizard_RunDLLA
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Calls the device problem wizard
|
||||
*
|
||||
* ARGUMENTS
|
||||
* hWndParent: Handle to the parent window
|
||||
* hInst: Handle to the application instance
|
||||
* lpDeviceCmd: A command that includes the DeviceID of the properties to be shown,
|
||||
* also see NOTEs
|
||||
* nCmdShow: Specifies how the window should be shown
|
||||
*
|
||||
* RETURN VALUE
|
||||
*
|
||||
* REVISIONS
|
||||
*
|
||||
* NOTE
|
||||
* - Win XP exports this function as DeviceProblenWizard_RunDLLA, apparently it's
|
||||
* a typo so we additionally export an alias function
|
||||
* - lpDeviceCmd is a string in the form of "/MachineName MACHINE /DeviceID DEVICEPATH"
|
||||
* (/MachineName is optional). This function only parses this string and eventually
|
||||
* calls DeviceProperties().
|
||||
*
|
||||
* @unimplemented
|
||||
*/
|
||||
VOID
|
||||
WINAPI
|
||||
DeviceProblemWizard_RunDLLA(HWND hWndParent,
|
||||
HINSTANCE hInst,
|
||||
LPCSTR lpDeviceCmd,
|
||||
int nCmdShow)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* NAME EXPORTED
|
||||
* DeviceProblemWizard_RunDLLW
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Calls the device problem wizard
|
||||
*
|
||||
* ARGUMENTS
|
||||
* hWndParent: Handle to the parent window
|
||||
* hInst: Handle to the application instance
|
||||
* lpDeviceCmd: A command that includes the DeviceID of the properties to be shown,
|
||||
* also see NOTEs
|
||||
* nCmdShow: Specifies how the window should be shown
|
||||
*
|
||||
* RETURN VALUE
|
||||
*
|
||||
* REVISIONS
|
||||
*
|
||||
* NOTE
|
||||
* - Win XP exports this function as DeviceProblenWizard_RunDLLA, apparently it's
|
||||
* a typo so we additionally export an alias function
|
||||
* - lpDeviceCmd is a string in the form of "/MachineName MACHINE /DeviceID DEVICEPATH"
|
||||
* (/MachineName is optional). This function only parses this string and eventually
|
||||
* calls DeviceProperties().
|
||||
*
|
||||
* @unimplemented
|
||||
*/
|
||||
VOID
|
||||
WINAPI
|
||||
DeviceProblemWizard_RunDLLW(HWND hWndParent,
|
||||
HINSTANCE hInst,
|
||||
LPCWSTR lpDeviceCmd,
|
||||
int nCmdShow)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* NAME EXPORTED
|
||||
* DeviceManagerPrintA
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Calls the device problem wizard
|
||||
*
|
||||
* ARGUMENTS
|
||||
* lpMachineName: Machine Name, NULL is the local machine
|
||||
* lpPrinter: Filename of the printer where it should be printed on
|
||||
* nPrintMode: Specifies what kind of information is to be printed
|
||||
* DEV_PRINT_ABSTRACT: Prints an abstract of system information, the parameters
|
||||
* uNumberOfGuids, Guids are ignored
|
||||
* DEV_PRINT_SELECTED: Prints information about the devices listed in Guids
|
||||
* DEV_PRINT_ALL: Prints an abstract of system information and all
|
||||
* system devices
|
||||
* uNumberOfGuids: Numbers of guids in the Guids array, this parameter is ignored unless
|
||||
* nPrintMode is DEV_PRINT_SELECTED
|
||||
* lpGuids: Array of device guids, this parameter is ignored unless
|
||||
* nPrintMode is DEV_PRINT_SELECTED
|
||||
*
|
||||
* RETURN VALUE
|
||||
* TRUE: if no errors occured
|
||||
* FALSE: if errors occured
|
||||
*
|
||||
* REVISIONS
|
||||
*
|
||||
* NOTE
|
||||
*
|
||||
* @unimplemented
|
||||
*/
|
||||
BOOL
|
||||
WINAPI
|
||||
DeviceManagerPrintA(LPCSTR lpMachineName,
|
||||
LPCSTR lpPrinter,
|
||||
int nPrintMode,
|
||||
UINT uNumberOfGuids,
|
||||
LPGUID lpGuids)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* NAME EXPORTED
|
||||
* DeviceManagerPrintW
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Calls the device problem wizard
|
||||
*
|
||||
* ARGUMENTS
|
||||
* lpMachineName: Machine Name, NULL is the local machine
|
||||
* lpPrinter: Filename of the printer where it should be printed on
|
||||
* nPrintMode: Specifies what kind of information is to be printed
|
||||
* DEV_PRINT_ABSTRACT: Prints an abstract of system information, the parameters
|
||||
* uNumberOfGuids, Guids are ignored
|
||||
* DEV_PRINT_SELECTED: Prints information about the devices listed in Guids
|
||||
* DEV_PRINT_ALL: Prints an abstract of system information and all
|
||||
* system devices
|
||||
* uNumberOfGuids: Numbers of guids in the Guids array, this parameter is ignored unless
|
||||
* nPrintMode is DEV_PRINT_SELECTED
|
||||
* lpGuids: Array of device guids, this parameter is ignored unless
|
||||
* nPrintMode is DEV_PRINT_SELECTED
|
||||
*
|
||||
* RETURN VALUE
|
||||
* TRUE: if no errors occured
|
||||
* FALSE: if errors occured
|
||||
*
|
||||
* REVISIONS
|
||||
*
|
||||
* NOTE
|
||||
*
|
||||
* @unimplemented
|
||||
*/
|
||||
BOOL
|
||||
WINAPI
|
||||
DeviceManagerPrintW(LPCWSTR lpMachineName,
|
||||
LPCWSTR lpPrinter,
|
||||
int nPrintMode,
|
||||
UINT uNumberOfGuids,
|
||||
LPGUID lpGuids)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
}
|
|
@ -819,17 +819,3 @@ HandleDefaultMessage:
|
|||
|
||||
return RetCode;
|
||||
}
|
||||
|
||||
|
||||
#if 1 // test
|
||||
BOOL
|
||||
WINAPI
|
||||
DeviceManager_ExecuteW(HWND hWndParent,
|
||||
HINSTANCE hInst,
|
||||
LPCWSTR lpMachineName,
|
||||
int nCmdShow)
|
||||
{
|
||||
CDeviceManager DevMgr;
|
||||
return DevMgr.Create(hWndParent, hInst, lpMachineName, nCmdShow);
|
||||
}
|
||||
#endif
|
|
@ -9,8 +9,8 @@
|
|||
#define REACTOS_STR_INTERNAL_NAME "devmgr"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "devmgr.dll"
|
||||
|
||||
#include <reactos/version.rc>
|
||||
#include <reactos/manifest_dll.rc>
|
||||
//#include <reactos/version.rc>
|
||||
//#include <reactos/manifest_dll.rc>
|
||||
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
|
||||
|
|
11
reactos/dll/win32/devmgr_new/includes/devmgr.h
Normal file
11
reactos/dll/win32/devmgr_new/includes/devmgr.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
|
||||
BOOL
|
||||
CreateDeviceManager(
|
||||
HWND hWndParent,
|
||||
HINSTANCE hInst,
|
||||
LPCWSTR lpMachineName,
|
||||
int nCmdShow
|
||||
);
|
||||
|
|
@ -27,7 +27,10 @@
|
|||
* 04-04-2004 Created
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
#include "stdafx.h"
|
||||
#include <devmgr\devmgr.h>"
|
||||
#include "properties.h"
|
||||
#include "resource.h"
|
||||
|
||||
#include <winver.h>
|
||||
|
||||
|
@ -768,9 +771,9 @@ DisplayDevicePropertyText(IN PDEVADVPROP_INFO dap,
|
|||
if (dwType == REG_SZ)
|
||||
dwSize += sizeof(WCHAR);
|
||||
|
||||
lpBuffer = HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
dwSize);
|
||||
lpBuffer = (LPBYTE)HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
dwSize);
|
||||
if (lpBuffer == NULL)
|
||||
{
|
||||
SetListViewText(hwndListView, 0, L"Error: Allocating the buffer failed!");
|
||||
|
@ -1075,7 +1078,7 @@ DisplayClassCoinstallers(IN PDEVADVPROP_INFO dap,
|
|||
HDEVINFO DeviceInfoSet;
|
||||
PSP_DEVINFO_DATA DeviceInfoData;
|
||||
WCHAR szClassGuid[45];
|
||||
HKEY hKey = INVALID_HANDLE_VALUE;
|
||||
HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;
|
||||
DWORD dwSize;
|
||||
DWORD dwType;
|
||||
LPBYTE lpBuffer = NULL;
|
||||
|
@ -1126,9 +1129,9 @@ DisplayClassCoinstallers(IN PDEVADVPROP_INFO dap,
|
|||
if (dwSize == 0)
|
||||
goto done;
|
||||
|
||||
lpBuffer = HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
dwSize);
|
||||
lpBuffer = (LPBYTE)HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
dwSize);
|
||||
|
||||
RegQueryValueEx(hKey,
|
||||
szClassGuid,
|
||||
|
@ -1201,9 +1204,9 @@ DisplayDeviceCoinstallers(IN PDEVADVPROP_INFO dap,
|
|||
dwSize > 0)
|
||||
{
|
||||
|
||||
lpBuffer = HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
dwSize);
|
||||
lpBuffer = (LPBYTE)HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
dwSize);
|
||||
|
||||
RegQueryValueEx(hKey,
|
||||
L"CoInstallers32",
|
||||
|
@ -1288,9 +1291,9 @@ DisplayClassProperties(IN PDEVADVPROP_INFO dap,
|
|||
&dwSize) == ERROR_SUCCESS &&
|
||||
dwSize > 0)
|
||||
{
|
||||
lpBuffer = HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
dwSize);
|
||||
lpBuffer = (LPBYTE)HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
dwSize);
|
||||
|
||||
RegQueryValueEx(hKey,
|
||||
lpProperty,
|
||||
|
@ -1347,9 +1350,9 @@ DisplayDeviceRelations(
|
|||
if (ret != CR_SUCCESS)
|
||||
return;
|
||||
|
||||
pszBuffer = HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
ulLength);
|
||||
pszBuffer = (LPWSTR)HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
ulLength);
|
||||
if (pszBuffer == NULL)
|
||||
return;
|
||||
|
||||
|
@ -1774,8 +1777,6 @@ UpdateDevInfo(IN HWND hwndDlg,
|
|||
DWORD nDriverPages = 0;
|
||||
BOOL RecalcPages = FALSE;
|
||||
|
||||
TRACE("UpdateDevInfo()\n");
|
||||
|
||||
hPropSheetDlg = GetParent(hwndDlg);
|
||||
|
||||
if (dap->PageInitialized)
|
||||
|
@ -2171,7 +2172,6 @@ GetParentNode:
|
|||
dap->PropertySheetType) &&
|
||||
nDriverPages != 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
TRACE("Count %d additional pages!\n", nDriverPages);
|
||||
dap->nDevPropSheets += nDriverPages;
|
||||
}
|
||||
else
|
||||
|
@ -2193,10 +2193,9 @@ TRACE("Count %d additional pages!\n", nDriverPages);
|
|||
/* add the device property sheets */
|
||||
if (dap->nDevPropSheets != 0)
|
||||
{
|
||||
TRACE("Show %d pages!\n", dap->nDevPropSheets);
|
||||
dap->DevPropSheets = HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
dap->nDevPropSheets * sizeof(HPROPSHEETPAGE));
|
||||
dap->DevPropSheets = (HPROPSHEETPAGE *)HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
dap->nDevPropSheets * sizeof(HPROPSHEETPAGE));
|
||||
if (dap->DevPropSheets != NULL)
|
||||
{
|
||||
if (nDriverPages != 0)
|
||||
|
@ -2216,25 +2215,17 @@ TRACE("Show %d pages!\n", dap->nDevPropSheets);
|
|||
iPage < nDriverPages;
|
||||
iPage++)
|
||||
{
|
||||
TRACE("Add page %d\n", iPage);
|
||||
TRACE("Sheet %p\n", dap->DevPropSheets[iPage]);
|
||||
|
||||
if (PropSheet_AddPage(hPropSheetDlg,
|
||||
dap->DevPropSheets[iPage]))
|
||||
{
|
||||
RecalcPages = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE("PropSheet_AddPage() failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
dap->FreeDevPropSheets = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE("SetupDiGetClassDevPropertySheets() failed\n");
|
||||
/* cleanup, we were unable to get the device property sheets */
|
||||
iPage = nDriverPages;
|
||||
dap->nDevPropSheets -= nDriverPages;
|
||||
|
@ -2602,11 +2593,11 @@ DisplayDeviceAdvancedProperties(IN HWND hWndParent,
|
|||
|
||||
/* create the internal structure associated with the "General",
|
||||
"Driver", ... pages */
|
||||
DevAdvPropInfo = HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
FIELD_OFFSET(DEVADVPROP_INFO,
|
||||
szDeviceID) +
|
||||
(DevIdSize * sizeof(WCHAR)));
|
||||
DevAdvPropInfo = (PDEVADVPROP_INFO)HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
FIELD_OFFSET(DEVADVPROP_INFO,
|
||||
szDeviceID) +
|
||||
(DevIdSize * sizeof(WCHAR)));
|
||||
if (DevAdvPropInfo == NULL)
|
||||
{
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
|
@ -2645,7 +2636,7 @@ DisplayDeviceAdvancedProperties(IN HWND hWndParent,
|
|||
DevAdvPropInfo->pCreatePropertySheetPageW = pCreatePropertySheetPageW;
|
||||
DevAdvPropInfo->pDestroyPropertySheetPage = pDestroyPropertySheetPage;
|
||||
|
||||
DevAdvPropInfo->IsAdmin = IsUserAdmin();
|
||||
DevAdvPropInfo->IsAdmin = TRUE;// IsUserAdmin();
|
||||
DevAdvPropInfo->DoDefaultDevAction = ((dwFlags & DPF_DEVICE_STATUS_ACTION) != 0);
|
||||
DevAdvPropInfo->Extended = ((dwFlags & DPF_EXTENDED) != 0);
|
||||
|
||||
|
@ -2658,9 +2649,9 @@ DisplayDeviceAdvancedProperties(IN HWND hWndParent,
|
|||
DIGCDP_FLAG_REMOTE_ADVANCED :
|
||||
DIGCDP_FLAG_ADVANCED;
|
||||
|
||||
psh.phpage = HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
1 * sizeof(HPROPSHEETPAGE));
|
||||
psh.phpage = (HPROPSHEETPAGE *)HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
1 * sizeof(HPROPSHEETPAGE));
|
||||
if (psh.phpage == NULL)
|
||||
{
|
||||
goto Cleanup;
|
|
@ -25,7 +25,10 @@
|
|||
* 04-04-2004 Created
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
#include "stdafx.h"
|
||||
#include <devmgr\devmgr.h>"
|
||||
#include "properties.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
BOOL
|
||||
|
@ -423,9 +426,9 @@ DeviceProblemTextA(IN HMACHINE hMachine OPTIONAL,
|
|||
|
||||
if (uMaxString != 0)
|
||||
{
|
||||
lpBuffer = HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
(uMaxString + 1) * sizeof(WCHAR));
|
||||
lpBuffer = (LPWSTR)HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
(uMaxString + 1) * sizeof(WCHAR));
|
||||
if (lpBuffer == NULL)
|
||||
{
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
@ -25,7 +25,10 @@
|
|||
* 04-04-2004 Created
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
#include "stdafx.h"
|
||||
#include <devmgr\devmgr.h>"
|
||||
#include "properties.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
typedef struct _HWDEVINFO
|
||||
|
@ -301,11 +304,11 @@ BuildDevicesList(IN PHARDWARE_PAGE_DATA hpd)
|
|||
|
||||
if (ClassDevInfo->HwDevInfo != NULL)
|
||||
{
|
||||
PHWDEVINFO HwNewDevInfo = HeapReAlloc(GetProcessHeap(),
|
||||
0,
|
||||
ClassDevInfo->HwDevInfo,
|
||||
(ClassDevInfo->ItemCount + 1) *
|
||||
sizeof(HWDEVINFO));
|
||||
PHWDEVINFO HwNewDevInfo = (PHWDEVINFO)HeapReAlloc(GetProcessHeap(),
|
||||
0,
|
||||
ClassDevInfo->HwDevInfo,
|
||||
(ClassDevInfo->ItemCount + 1) *
|
||||
sizeof(HWDEVINFO));
|
||||
if (HwNewDevInfo != NULL)
|
||||
{
|
||||
ClassDevInfo->HwDevInfo = HwNewDevInfo;
|
||||
|
@ -319,9 +322,9 @@ BuildDevicesList(IN PHARDWARE_PAGE_DATA hpd)
|
|||
}
|
||||
else
|
||||
{
|
||||
ClassDevInfo->HwDevInfo = HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
sizeof(HWDEVINFO));
|
||||
ClassDevInfo->HwDevInfo = (PHWDEVINFO)HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
sizeof(HWDEVINFO));
|
||||
if (ClassDevInfo->HwDevInfo == NULL)
|
||||
{
|
||||
ERR("Unable to allocate memory for a SP_DEVINFO_DATA structures!\n");
|
||||
|
@ -364,9 +367,9 @@ DeviceIdMatch(IN HDEVINFO DeviceInfoSet,
|
|||
{
|
||||
if (DevIdLen == wcslen(lpDeviceId) + 1)
|
||||
{
|
||||
lpQueriedDeviceId = HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
DevIdLen * sizeof(WCHAR));
|
||||
lpQueriedDeviceId = (LPWSTR)HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
DevIdLen * sizeof(WCHAR));
|
||||
if (lpQueriedDeviceId != NULL)
|
||||
{
|
||||
if (SetupDiGetDeviceInstanceId(DeviceInfoSet,
|
||||
|
@ -414,8 +417,8 @@ FillDevicesListViewControl(IN PHARDWARE_PAGE_DATA hpd,
|
|||
LastHwDevInfo = HwDevInfo + ClassDevInfo->ItemCount;
|
||||
|
||||
SelectedInClass = (SelectedClassGuid != NULL &&
|
||||
IsEqualGUID(SelectedClassGuid,
|
||||
&ClassDevInfo->Guid));
|
||||
IsEqualGUID(*SelectedClassGuid,
|
||||
ClassDevInfo->Guid));
|
||||
while (HwDevInfo != LastHwDevInfo)
|
||||
{
|
||||
INT iItem;
|
||||
|
@ -497,9 +500,9 @@ UpdateDevicesListViewControl(IN PHARDWARE_PAGE_DATA hpd)
|
|||
GetLastError() == ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
SelectedClassGuid = HwDevInfo->DevInfoData.ClassGuid;
|
||||
lpDeviceId = HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
DevIdLen * sizeof(WCHAR));
|
||||
lpDeviceId = (LPWSTR)HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
DevIdLen * sizeof(WCHAR));
|
||||
if (lpDeviceId != NULL &&
|
||||
!SetupDiGetDeviceInstanceId(HwDevInfo->ClassDevInfo->hDevInfo,
|
||||
&HwDevInfo->DevInfoData,
|
||||
|
@ -1029,10 +1032,10 @@ DeviceCreateHardwarePageEx(IN HWND hWndParent,
|
|||
/* allocate the HARDWARE_PAGE_DATA structure. Make sure it is
|
||||
zeroed because the initialization code assumes that in
|
||||
failure cases! */
|
||||
hpd = HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
FIELD_OFFSET(HARDWARE_PAGE_DATA,
|
||||
ClassDevInfo[uNumberOfGuids]));
|
||||
hpd = (PHARDWARE_PAGE_DATA)HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
FIELD_OFFSET(HARDWARE_PAGE_DATA,
|
||||
ClassDevInfo[uNumberOfGuids]));
|
||||
if (hpd != NULL)
|
||||
{
|
||||
HWND hWnd;
|
|
@ -7,7 +7,10 @@
|
|||
* 2005/11/24 Created
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
#include "stdafx.h"
|
||||
#include <devmgr\devmgr.h>"
|
||||
#include "properties.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
typedef struct
|
||||
|
@ -47,7 +50,7 @@ typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR {
|
|||
} Interrupt;
|
||||
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
|
||||
struct {
|
||||
_ANONYMOUS_UNION union {
|
||||
union {
|
||||
struct {
|
||||
#if defined(NT_PROCESSOR_GROUPS)
|
||||
USHORT Group;
|
|
@ -25,8 +25,10 @@
|
|||
* 2005/11/24 Created
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <devmgr\devmgr.h>"
|
||||
#include "properties.h"
|
||||
#include "resource.h"
|
||||
|
||||
HINSTANCE hDllInstance = NULL;
|
||||
|
||||
|
@ -49,7 +51,7 @@ LengthOfStrResource(IN HINSTANCE hInst,
|
|||
/* Find the string table block */
|
||||
if ((hrSrc = FindResourceW(hInst, lpName, (LPWSTR)RT_STRING)) &&
|
||||
(hRes = LoadResource(hInst, hrSrc)) &&
|
||||
(lpStr = LockResource(hRes)))
|
||||
(lpStr = (LPWSTR)LockResource(hRes)))
|
||||
{
|
||||
UINT x;
|
||||
|
||||
|
@ -251,9 +253,9 @@ ConvertMultiByteToUnicode(IN LPCSTR lpMultiByteStr,
|
|||
if (nLength == 0)
|
||||
return NULL;
|
||||
|
||||
lpUnicodeStr = HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
nLength * sizeof(WCHAR));
|
||||
lpUnicodeStr = (LPWSTR)HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
nLength * sizeof(WCHAR));
|
||||
if (lpUnicodeStr == NULL)
|
||||
{
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
|
@ -462,7 +464,7 @@ GetDeviceStatusString(IN DEVINST DevInst,
|
|||
{
|
||||
UINT uRet;
|
||||
|
||||
uRet = DeviceProblemText(hMachine,
|
||||
uRet = DeviceProblemTextW(hMachine,
|
||||
DevInst,
|
||||
ProblemNumber,
|
||||
szBuffer,
|
||||
|
@ -925,7 +927,7 @@ FindCurrentDriver(IN HDEVINFO DeviceInfoSet,
|
|||
IN PSP_DEVINFO_DATA DeviceInfoData,
|
||||
OUT PSP_DRVINFO_DATA DriverInfoData)
|
||||
{
|
||||
HKEY hKey = INVALID_HANDLE_VALUE;
|
||||
HKEY hKey = (HKEY)INVALID_HANDLE_VALUE;
|
||||
SP_DEVINSTALL_PARAMS InstallParams = {0};
|
||||
SP_DRVINFO_DETAIL_DATA DriverInfoDetailData = {0};
|
||||
WCHAR InfPath[MAX_PATH];
|
||||
|
@ -1078,7 +1080,7 @@ FindCurrentDriver(IN HDEVINFO DeviceInfoSet,
|
|||
ERR("SetupDiGetDriverInfoDetail() failed with error 0x%lx\n", GetLastError());
|
||||
goto Cleanup;
|
||||
}
|
||||
if (!wcsicmp(DriverInfoDetailData.SectionName,
|
||||
if (!_wcsicmp(DriverInfoDetailData.SectionName,
|
||||
InfSection) != 0)
|
||||
{
|
||||
/* We have found the right driver */
|
|
@ -1,26 +1,7 @@
|
|||
#ifndef __DEVMGR_H
|
||||
#define __DEVMGR_H
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define WIN32_NO_STATUS
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include <winreg.h>
|
||||
#include <winnls.h>
|
||||
#include <winuser.h>
|
||||
#include <wchar.h>
|
||||
#include <regstr.h>
|
||||
#include <setupapi.h>
|
||||
#include <cfgmgr32.h>
|
||||
#include <dll/newdevp.h>
|
||||
#include <dll/devmgr/devmgr.h>
|
||||
#include <wine/debug.h>
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(devmgr);
|
||||
//WINE_DEFAULT_DEBUG_CHANNEL(devmgr);
|
||||
|
||||
extern HINSTANCE hDllInstance;
|
||||
|
|
@ -1,257 +0,0 @@
|
|||
/*
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS devmgr.dll
|
||||
* FILE: lib/devmgr/stubs.c
|
||||
* PURPOSE: devmgr.dll stubs
|
||||
* PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
|
||||
* NOTES: If you implement a function, remove it from this file
|
||||
*
|
||||
* Some helpful resources:
|
||||
* http://support.microsoft.com/default.aspx?scid=kb;%5BLN%5D;815320
|
||||
* http://www.jsiinc.com/SUBO/tip7400/rh7482.htm
|
||||
* http://www.jsiinc.com/SUBM/tip6400/rh6490.htm
|
||||
*
|
||||
* UPDATE HISTORY:
|
||||
* 04-04-2004 Created
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* NAME EXPORTED
|
||||
* DeviceManager_ExecuteA
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Starts the Device Manager
|
||||
*
|
||||
* ARGUMENTS
|
||||
* hWndParent: Handle to the parent window
|
||||
* hInst: Handle to the application instance
|
||||
* lpMachineName: Machine Name, NULL is the local machine
|
||||
* nCmdShow: Specifies how the window should be shown
|
||||
*
|
||||
* RETURN VALUE
|
||||
* TRUE: if no errors occured
|
||||
* FALSE: if the device manager could not be executed
|
||||
*
|
||||
* REVISIONS
|
||||
*
|
||||
* NOTE
|
||||
* - Win runs the device manager in a separate process, so hWndParent is somehow
|
||||
* obsolete.
|
||||
*
|
||||
* @unimplemented
|
||||
*/
|
||||
BOOL
|
||||
WINAPI
|
||||
DeviceManager_ExecuteA(HWND hWndParent,
|
||||
HINSTANCE hInst,
|
||||
LPCSTR lpMachineName,
|
||||
int nCmdShow)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* NAME EXPORTED
|
||||
* DeviceManager_ExecuteW
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Starts the Device Manager
|
||||
*
|
||||
* ARGUMENTS
|
||||
* hWndParent: Handle to the parent window
|
||||
* hInst: Handle to the application instance
|
||||
* lpMachineName: Machine Name, NULL is the local machine
|
||||
* nCmdShow: Specifies how the window should be shown
|
||||
*
|
||||
* RETURN VALUE
|
||||
* TRUE: if no errors occured
|
||||
* FALSE: if the device manager could not be executed
|
||||
*
|
||||
* REVISIONS
|
||||
*
|
||||
* NOTE
|
||||
* - Win runs the device manager in a separate process, so hWndParent is somehow
|
||||
* obsolete.
|
||||
*
|
||||
* @unimplemented
|
||||
*/
|
||||
//BOOL
|
||||
//WINAPI
|
||||
//DeviceManager_ExecuteW(HWND hWndParent,
|
||||
// HINSTANCE hInst,
|
||||
// LPCWSTR lpMachineName,
|
||||
// int nCmdShow)
|
||||
//{
|
||||
// UNIMPLEMENTED;
|
||||
// return FALSE;
|
||||
//}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* NAME EXPORTED
|
||||
* DeviceProblemWizard_RunDLLA
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Calls the device problem wizard
|
||||
*
|
||||
* ARGUMENTS
|
||||
* hWndParent: Handle to the parent window
|
||||
* hInst: Handle to the application instance
|
||||
* lpDeviceCmd: A command that includes the DeviceID of the properties to be shown,
|
||||
* also see NOTEs
|
||||
* nCmdShow: Specifies how the window should be shown
|
||||
*
|
||||
* RETURN VALUE
|
||||
*
|
||||
* REVISIONS
|
||||
*
|
||||
* NOTE
|
||||
* - Win XP exports this function as DeviceProblenWizard_RunDLLA, apparently it's
|
||||
* a typo so we additionally export an alias function
|
||||
* - lpDeviceCmd is a string in the form of "/MachineName MACHINE /DeviceID DEVICEPATH"
|
||||
* (/MachineName is optional). This function only parses this string and eventually
|
||||
* calls DeviceProperties().
|
||||
*
|
||||
* @unimplemented
|
||||
*/
|
||||
VOID
|
||||
WINAPI
|
||||
DeviceProblemWizard_RunDLLA(HWND hWndParent,
|
||||
HINSTANCE hInst,
|
||||
LPCSTR lpDeviceCmd,
|
||||
int nCmdShow)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* NAME EXPORTED
|
||||
* DeviceProblemWizard_RunDLLW
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Calls the device problem wizard
|
||||
*
|
||||
* ARGUMENTS
|
||||
* hWndParent: Handle to the parent window
|
||||
* hInst: Handle to the application instance
|
||||
* lpDeviceCmd: A command that includes the DeviceID of the properties to be shown,
|
||||
* also see NOTEs
|
||||
* nCmdShow: Specifies how the window should be shown
|
||||
*
|
||||
* RETURN VALUE
|
||||
*
|
||||
* REVISIONS
|
||||
*
|
||||
* NOTE
|
||||
* - Win XP exports this function as DeviceProblenWizard_RunDLLA, apparently it's
|
||||
* a typo so we additionally export an alias function
|
||||
* - lpDeviceCmd is a string in the form of "/MachineName MACHINE /DeviceID DEVICEPATH"
|
||||
* (/MachineName is optional). This function only parses this string and eventually
|
||||
* calls DeviceProperties().
|
||||
*
|
||||
* @unimplemented
|
||||
*/
|
||||
VOID
|
||||
WINAPI
|
||||
DeviceProblemWizard_RunDLLW(HWND hWndParent,
|
||||
HINSTANCE hInst,
|
||||
LPCWSTR lpDeviceCmd,
|
||||
int nCmdShow)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* NAME EXPORTED
|
||||
* DeviceManagerPrintA
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Calls the device problem wizard
|
||||
*
|
||||
* ARGUMENTS
|
||||
* lpMachineName: Machine Name, NULL is the local machine
|
||||
* lpPrinter: Filename of the printer where it should be printed on
|
||||
* nPrintMode: Specifies what kind of information is to be printed
|
||||
* DEV_PRINT_ABSTRACT: Prints an abstract of system information, the parameters
|
||||
* uNumberOfGuids, Guids are ignored
|
||||
* DEV_PRINT_SELECTED: Prints information about the devices listed in Guids
|
||||
* DEV_PRINT_ALL: Prints an abstract of system information and all
|
||||
* system devices
|
||||
* uNumberOfGuids: Numbers of guids in the Guids array, this parameter is ignored unless
|
||||
* nPrintMode is DEV_PRINT_SELECTED
|
||||
* lpGuids: Array of device guids, this parameter is ignored unless
|
||||
* nPrintMode is DEV_PRINT_SELECTED
|
||||
*
|
||||
* RETURN VALUE
|
||||
* TRUE: if no errors occured
|
||||
* FALSE: if errors occured
|
||||
*
|
||||
* REVISIONS
|
||||
*
|
||||
* NOTE
|
||||
*
|
||||
* @unimplemented
|
||||
*/
|
||||
BOOL
|
||||
WINAPI
|
||||
DeviceManagerPrintA(LPCSTR lpMachineName,
|
||||
LPCSTR lpPrinter,
|
||||
int nPrintMode,
|
||||
UINT uNumberOfGuids,
|
||||
LPGUID lpGuids)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* NAME EXPORTED
|
||||
* DeviceManagerPrintW
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Calls the device problem wizard
|
||||
*
|
||||
* ARGUMENTS
|
||||
* lpMachineName: Machine Name, NULL is the local machine
|
||||
* lpPrinter: Filename of the printer where it should be printed on
|
||||
* nPrintMode: Specifies what kind of information is to be printed
|
||||
* DEV_PRINT_ABSTRACT: Prints an abstract of system information, the parameters
|
||||
* uNumberOfGuids, Guids are ignored
|
||||
* DEV_PRINT_SELECTED: Prints information about the devices listed in Guids
|
||||
* DEV_PRINT_ALL: Prints an abstract of system information and all
|
||||
* system devices
|
||||
* uNumberOfGuids: Numbers of guids in the Guids array, this parameter is ignored unless
|
||||
* nPrintMode is DEV_PRINT_SELECTED
|
||||
* lpGuids: Array of device guids, this parameter is ignored unless
|
||||
* nPrintMode is DEV_PRINT_SELECTED
|
||||
*
|
||||
* RETURN VALUE
|
||||
* TRUE: if no errors occured
|
||||
* FALSE: if errors occured
|
||||
*
|
||||
* REVISIONS
|
||||
*
|
||||
* NOTE
|
||||
*
|
||||
* @unimplemented
|
||||
*/
|
||||
BOOL
|
||||
WINAPI
|
||||
DeviceManagerPrintW(LPCWSTR lpMachineName,
|
||||
LPCWSTR lpPrinter,
|
||||
int nPrintMode,
|
||||
UINT uNumberOfGuids,
|
||||
LPGUID lpGuids)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
}
|
36
reactos/dll/win32/devmgr_new/properties/stubs.cpp
Normal file
36
reactos/dll/win32/devmgr_new/properties/stubs.cpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS devmgr.dll
|
||||
* FILE: lib/devmgr/stubs.c
|
||||
* PURPOSE: devmgr.dll stubs
|
||||
* PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
|
||||
* NOTES: If you implement a function, remove it from this file
|
||||
*
|
||||
* Some helpful resources:
|
||||
* http://support.microsoft.com/default.aspx?scid=kb;%5BLN%5D;815320
|
||||
* http://www.jsiinc.com/SUBO/tip7400/rh7482.htm
|
||||
* http://www.jsiinc.com/SUBM/tip6400/rh6490.htm
|
||||
*
|
||||
* UPDATE HISTORY:
|
||||
* 04-04-2004 Created
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// remove me
|
||||
BOOL
|
||||
WINAPI
|
||||
InstallDevInst(
|
||||
IN HWND hWndParent,
|
||||
IN LPCWSTR InstanceId,
|
||||
IN BOOL bUpdate,
|
||||
OUT LPDWORD lpReboot)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
unsigned long __stdcall pSetupGuidFromString(wchar_t const *, struct _GUID *)
|
||||
{
|
||||
return 1;
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
#include <Cfgmgr32.h>
|
||||
#include <devguid.h>
|
||||
#include <process.h>
|
||||
|
||||
#include <RegStr.h>
|
||||
|
||||
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
|
||||
#include <tchar.h>
|
||||
|
@ -21,6 +21,20 @@
|
|||
#include <atlcoll.h>
|
||||
|
||||
#include <strsafe.h>
|
||||
|
||||
#define ERR printf
|
||||
#define FIXME printf
|
||||
|
||||
DWORD WINAPI pSetupGuidFromString(PCWSTR pString, LPGUID lpGUID);
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
InstallDevInst(
|
||||
IN HWND hWndParent,
|
||||
IN LPCWSTR InstanceId,
|
||||
IN BOOL bUpdate,
|
||||
OUT LPDWORD lpReboot);
|
||||
|
||||
#else
|
||||
|
||||
#include <string.h>
|
Loading…
Reference in a new issue