mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 07:43:12 +00:00
initial implementation of DeviceAdvancedPropertiesA/W
svn path=/trunk/; revision=19604
This commit is contained in:
parent
23970ac711
commit
2f90929822
5 changed files with 72 additions and 79 deletions
|
@ -13,6 +13,7 @@
|
||||||
<library>setupapi</library>
|
<library>setupapi</library>
|
||||||
<library>user32</library>
|
<library>user32</library>
|
||||||
<file>devmgr.rc</file>
|
<file>devmgr.rc</file>
|
||||||
|
<file>advprop.c</file>
|
||||||
<file>hwpage.c</file>
|
<file>hwpage.c</file>
|
||||||
<file>misc.c</file>
|
<file>misc.c</file>
|
||||||
<file>stubs.c</file>
|
<file>stubs.c</file>
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
typedef VOID (WINAPI *PINITCOMMONCONTROLS)(VOID);
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
HWPD_STANDARDLIST = 0,
|
HWPD_STANDARDLIST = 0,
|
||||||
|
@ -978,7 +976,6 @@ DeviceCreateHardwarePageEx(IN HWND hWndParent,
|
||||||
IN HWPAGE_DISPLAYMODE DisplayMode)
|
IN HWPAGE_DISPLAYMODE DisplayMode)
|
||||||
{
|
{
|
||||||
PHARDWARE_PAGE_DATA hpd;
|
PHARDWARE_PAGE_DATA hpd;
|
||||||
PINITCOMMONCONTROLS pInitCommonControls;
|
|
||||||
|
|
||||||
/* allocate the HARDWARE_PAGE_DATA structure. Make sure it is
|
/* allocate the HARDWARE_PAGE_DATA structure. Make sure it is
|
||||||
zeroed because the initialization code assumes that in
|
zeroed because the initialization code assumes that in
|
||||||
|
@ -1006,21 +1003,12 @@ DeviceCreateHardwarePageEx(IN HWND hWndParent,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* load comctl32.dll dynamically */
|
/* load comctl32.dll dynamically */
|
||||||
hpd->hComCtl32 = LoadLibrary(TEXT("comctl32.dll"));
|
hpd->hComCtl32 = LoadAndInitComctl32();
|
||||||
if (hpd->hComCtl32 == NULL)
|
if (hpd->hComCtl32 == NULL)
|
||||||
{
|
{
|
||||||
goto Cleanup;
|
goto Cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize the common controls */
|
|
||||||
pInitCommonControls = (PINITCOMMONCONTROLS)GetProcAddress(hpd->hComCtl32,
|
|
||||||
"InitCommonControls");
|
|
||||||
if (pInitCommonControls == NULL)
|
|
||||||
{
|
|
||||||
goto Cleanup;
|
|
||||||
}
|
|
||||||
pInitCommonControls();
|
|
||||||
|
|
||||||
/* create the dialog */
|
/* create the dialog */
|
||||||
hWnd = CreateDialogParam(hDllInstance,
|
hWnd = CreateDialogParam(hDllInstance,
|
||||||
MAKEINTRESOURCE(IDD_HARDWARE),
|
MAKEINTRESOURCE(IDD_HARDWARE),
|
||||||
|
|
|
@ -149,6 +149,69 @@ ListViewGetSelectedItemData(IN HWND hwnd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LPWSTR
|
||||||
|
ConvertMultiByteToUnicode(IN LPCSTR lpMultiByteStr,
|
||||||
|
IN UINT uCodePage)
|
||||||
|
{
|
||||||
|
LPWSTR lpUnicodeStr;
|
||||||
|
INT nLength;
|
||||||
|
|
||||||
|
nLength = MultiByteToWideChar(uCodePage,
|
||||||
|
0,
|
||||||
|
lpMultiByteStr,
|
||||||
|
-1,
|
||||||
|
NULL,
|
||||||
|
0);
|
||||||
|
if (nLength == 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
lpUnicodeStr = HeapAlloc(GetProcessHeap(),
|
||||||
|
0,
|
||||||
|
nLength * sizeof(WCHAR));
|
||||||
|
if (lpUnicodeStr == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (!MultiByteToWideChar(uCodePage,
|
||||||
|
0,
|
||||||
|
lpMultiByteStr,
|
||||||
|
nLength,
|
||||||
|
lpUnicodeStr,
|
||||||
|
nLength))
|
||||||
|
{
|
||||||
|
HeapFree(GetProcessHeap(),
|
||||||
|
0,
|
||||||
|
lpUnicodeStr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return lpUnicodeStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
HINSTANCE
|
||||||
|
LoadAndInitComctl32(VOID)
|
||||||
|
{
|
||||||
|
typedef VOID (WINAPI *PINITCOMMONCONTROLS)(VOID);
|
||||||
|
PINITCOMMONCONTROLS pInitCommonControls;
|
||||||
|
HINSTANCE hComCtl32;
|
||||||
|
|
||||||
|
hComCtl32 = LoadLibrary(L"comctl32.dll");
|
||||||
|
if (hComCtl32 != NULL)
|
||||||
|
{
|
||||||
|
/* initialize the common controls */
|
||||||
|
pInitCommonControls = (PINITCOMMONCONTROLS)GetProcAddress(hComCtl32,
|
||||||
|
"InitCommonControls");
|
||||||
|
if (pInitCommonControls == NULL)
|
||||||
|
{
|
||||||
|
FreeLibrary(hComCtl32);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
pInitCommonControls();
|
||||||
|
}
|
||||||
|
|
||||||
|
return hComCtl32;
|
||||||
|
}
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
STDCALL
|
STDCALL
|
||||||
DllMain(IN HINSTANCE hinstDLL,
|
DllMain(IN HINSTANCE hinstDLL,
|
||||||
|
|
|
@ -191,6 +191,13 @@ LoadAndFormatString(IN HINSTANCE hInstance,
|
||||||
LPARAM
|
LPARAM
|
||||||
ListViewGetSelectedItemData(IN HWND hwnd);
|
ListViewGetSelectedItemData(IN HWND hwnd);
|
||||||
|
|
||||||
|
LPWSTR
|
||||||
|
ConvertMultiByteToUnicode(IN LPCSTR lpMultiByteStr,
|
||||||
|
IN UINT uCodePage);
|
||||||
|
|
||||||
|
HINSTANCE
|
||||||
|
LoadAndInitComctl32(VOID);
|
||||||
|
|
||||||
#endif /* __DEVMGR_H */
|
#endif /* __DEVMGR_H */
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -546,72 +546,6 @@ DeviceManagerPrintW(LPCWSTR lpMachineName,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
|
||||||
* NAME EXPORTED
|
|
||||||
* DeviceAdvancedPropertiesA
|
|
||||||
*
|
|
||||||
* DESCRIPTION
|
|
||||||
* Invokes the device properties dialog, this version may add some property pages
|
|
||||||
* for some devices
|
|
||||||
*
|
|
||||||
* ARGUMENTS
|
|
||||||
* hWndParent: Handle to the parent window
|
|
||||||
* lpMachineName: Machine Name, NULL is the local machine
|
|
||||||
* lpDeviceID: Specifies the device whose properties are to be shown
|
|
||||||
*
|
|
||||||
* RETURN VALUE
|
|
||||||
* -1: if errors occured
|
|
||||||
*
|
|
||||||
* REVISIONS
|
|
||||||
*
|
|
||||||
* NOTE
|
|
||||||
*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
WINAPI
|
|
||||||
DeviceAdvancedPropertiesA(HWND hWndParent,
|
|
||||||
LPCSTR lpMachineName,
|
|
||||||
LPCSTR lpDeviceID)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
|
||||||
* NAME EXPORTED
|
|
||||||
* DeviceAdvancedPropertiesW
|
|
||||||
*
|
|
||||||
* DESCRIPTION
|
|
||||||
* Invokes the device properties dialog, this version may add some property pages
|
|
||||||
* for some devices
|
|
||||||
*
|
|
||||||
* ARGUMENTS
|
|
||||||
* hWndParent: Handle to the parent window
|
|
||||||
* lpMachineName: Machine Name, NULL is the local machine
|
|
||||||
* lpDeviceID: Specifies the device whose properties are to be shown
|
|
||||||
*
|
|
||||||
* RETURN VALUE
|
|
||||||
* -1: if errors occured
|
|
||||||
*
|
|
||||||
* REVISIONS
|
|
||||||
*
|
|
||||||
* NOTE
|
|
||||||
*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
WINAPI
|
|
||||||
DeviceAdvancedPropertiesW(HWND hWndParent,
|
|
||||||
LPCWSTR lpMachineName,
|
|
||||||
LPCWSTR lpDeviceID)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* NAME EXPORTED
|
* NAME EXPORTED
|
||||||
* DevicePropertiesExA
|
* DevicePropertiesExA
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue