diff --git a/reactos/dll/win32/devmgr_new/CMakeLists.txt b/reactos/dll/win32/devmgr_new/CMakeLists.txt index c8e865467fd..a21c4afbfde 100644 --- a/reactos/dll/win32/devmgr_new/CMakeLists.txt +++ b/reactos/dll/win32/devmgr_new/CMakeLists.txt @@ -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 diff --git a/reactos/dll/win32/devmgr_new/api.c b/reactos/dll/win32/devmgr_new/api.c deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/reactos/dll/win32/devmgr_new/api.cpp b/reactos/dll/win32/devmgr_new/api.cpp new file mode 100644 index 00000000000..8850777c5a3 --- /dev/null +++ b/reactos/dll/win32/devmgr_new/api.cpp @@ -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; +} diff --git a/reactos/dll/win32/devmgr_new/devmgmt/MainWindow.cpp b/reactos/dll/win32/devmgr_new/devmgmt/MainWindow.cpp index 7af9f3a60d5..07dd13f26fe 100644 --- a/reactos/dll/win32/devmgr_new/devmgmt/MainWindow.cpp +++ b/reactos/dll/win32/devmgr_new/devmgmt/MainWindow.cpp @@ -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 \ No newline at end of file diff --git a/reactos/dll/win32/devmgr_new/devmgr.rc b/reactos/dll/win32/devmgr_new/devmgr.rc index fb697400bd1..85b74a2db32 100644 --- a/reactos/dll/win32/devmgr_new/devmgr.rc +++ b/reactos/dll/win32/devmgr_new/devmgr.rc @@ -9,8 +9,8 @@ #define REACTOS_STR_INTERNAL_NAME "devmgr" #define REACTOS_STR_ORIGINAL_FILENAME "devmgr.dll" -#include -#include +//#include +//#include LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL diff --git a/reactos/dll/win32/devmgr_new/includes/devmgr.h b/reactos/dll/win32/devmgr_new/includes/devmgr.h new file mode 100644 index 00000000000..1b0326cda0f --- /dev/null +++ b/reactos/dll/win32/devmgr_new/includes/devmgr.h @@ -0,0 +1,11 @@ +#pragma once + + +BOOL +CreateDeviceManager( + HWND hWndParent, + HINSTANCE hInst, + LPCWSTR lpMachineName, + int nCmdShow +); + diff --git a/reactos/dll/win32/devmgr_new/properties/advprop.c b/reactos/dll/win32/devmgr_new/properties/advprop.cpp similarity index 98% rename from reactos/dll/win32/devmgr_new/properties/advprop.c rename to reactos/dll/win32/devmgr_new/properties/advprop.cpp index 2b83fb53b2e..d7023c8d651 100644 --- a/reactos/dll/win32/devmgr_new/properties/advprop.c +++ b/reactos/dll/win32/devmgr_new/properties/advprop.cpp @@ -27,7 +27,10 @@ * 04-04-2004 Created */ -#include "precomp.h" +#include "stdafx.h" +#include " +#include "properties.h" +#include "resource.h" #include @@ -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; diff --git a/reactos/dll/win32/devmgr_new/properties/devprblm.c b/reactos/dll/win32/devmgr_new/properties/devprblm.cpp similarity index 98% rename from reactos/dll/win32/devmgr_new/properties/devprblm.c rename to reactos/dll/win32/devmgr_new/properties/devprblm.cpp index 9d684dbee19..6ce4afe045e 100644 --- a/reactos/dll/win32/devmgr_new/properties/devprblm.c +++ b/reactos/dll/win32/devmgr_new/properties/devprblm.cpp @@ -25,7 +25,10 @@ * 04-04-2004 Created */ -#include "precomp.h" +#include "stdafx.h" +#include " +#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); diff --git a/reactos/dll/win32/devmgr_new/properties/hwpage.c b/reactos/dll/win32/devmgr_new/properties/hwpage.cpp similarity index 95% rename from reactos/dll/win32/devmgr_new/properties/hwpage.c rename to reactos/dll/win32/devmgr_new/properties/hwpage.cpp index 2d7eae63389..bb40361ad94 100644 --- a/reactos/dll/win32/devmgr_new/properties/hwpage.c +++ b/reactos/dll/win32/devmgr_new/properties/hwpage.cpp @@ -25,7 +25,10 @@ * 04-04-2004 Created */ -#include "precomp.h" +#include "stdafx.h" +#include " +#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; diff --git a/reactos/dll/win32/devmgr_new/properties/hwresource.c b/reactos/dll/win32/devmgr_new/properties/hwresource.cpp similarity index 98% rename from reactos/dll/win32/devmgr_new/properties/hwresource.c rename to reactos/dll/win32/devmgr_new/properties/hwresource.cpp index fcc80956c0d..1fbbbbfb24e 100644 --- a/reactos/dll/win32/devmgr_new/properties/hwresource.c +++ b/reactos/dll/win32/devmgr_new/properties/hwresource.cpp @@ -7,7 +7,10 @@ * 2005/11/24 Created */ -#include "precomp.h" +#include "stdafx.h" +#include " +#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; diff --git a/reactos/dll/win32/devmgr_new/properties/misc.c b/reactos/dll/win32/devmgr_new/properties/misc.cpp similarity index 98% rename from reactos/dll/win32/devmgr_new/properties/misc.c rename to reactos/dll/win32/devmgr_new/properties/misc.cpp index 1ecc44ce786..59b784a30d4 100644 --- a/reactos/dll/win32/devmgr_new/properties/misc.c +++ b/reactos/dll/win32/devmgr_new/properties/misc.cpp @@ -25,8 +25,10 @@ * 2005/11/24 Created */ -#include "precomp.h" - +#include "stdafx.h" +#include " +#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 */ diff --git a/reactos/dll/win32/devmgr_new/precomp.h b/reactos/dll/win32/devmgr_new/properties/properties.h similarity index 93% rename from reactos/dll/win32/devmgr_new/precomp.h rename to reactos/dll/win32/devmgr_new/properties/properties.h index 0c6593dfa3d..5e271add808 100644 --- a/reactos/dll/win32/devmgr_new/precomp.h +++ b/reactos/dll/win32/devmgr_new/properties/properties.h @@ -1,26 +1,7 @@ #ifndef __DEVMGR_H #define __DEVMGR_H -#include -#include - -#define WIN32_NO_STATUS -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "resource.h" - -WINE_DEFAULT_DEBUG_CHANNEL(devmgr); +//WINE_DEFAULT_DEBUG_CHANNEL(devmgr); extern HINSTANCE hDllInstance; diff --git a/reactos/dll/win32/devmgr_new/properties/stubs.c b/reactos/dll/win32/devmgr_new/properties/stubs.c deleted file mode 100644 index 3c5f58b413d..00000000000 --- a/reactos/dll/win32/devmgr_new/properties/stubs.c +++ /dev/null @@ -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; -} diff --git a/reactos/dll/win32/devmgr_new/properties/stubs.cpp b/reactos/dll/win32/devmgr_new/properties/stubs.cpp new file mode 100644 index 00000000000..6320939e455 --- /dev/null +++ b/reactos/dll/win32/devmgr_new/properties/stubs.cpp @@ -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; +} \ No newline at end of file diff --git a/reactos/dll/win32/devmgr_new/devmgmt/stdafx.h b/reactos/dll/win32/devmgr_new/stdafx.h similarity index 79% rename from reactos/dll/win32/devmgr_new/devmgmt/stdafx.h rename to reactos/dll/win32/devmgr_new/stdafx.h index 8802296384d..dc4d66a7c4c 100644 --- a/reactos/dll/win32/devmgr_new/devmgmt/stdafx.h +++ b/reactos/dll/win32/devmgr_new/stdafx.h @@ -12,7 +12,7 @@ #include #include #include - +#include #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit #include @@ -21,6 +21,20 @@ #include #include + +#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