<library>setupapi</library>
<library>user32</library>
<file>devmgr.rc</file>
+ <file>advprop.c</file>
<file>hwpage.c</file>
<file>misc.c</file>
<file>stubs.c</file>
#define NDEBUG
#include <debug.h>
-typedef VOID (WINAPI *PINITCOMMONCONTROLS)(VOID);
-
typedef enum
{
HWPD_STANDARDLIST = 0,
IN HWPAGE_DISPLAYMODE DisplayMode)
{
PHARDWARE_PAGE_DATA hpd;
- PINITCOMMONCONTROLS pInitCommonControls;
/* allocate the HARDWARE_PAGE_DATA structure. Make sure it is
zeroed because the initialization code assumes that in
}
/* load comctl32.dll dynamically */
- hpd->hComCtl32 = LoadLibrary(TEXT("comctl32.dll"));
+ hpd->hComCtl32 = LoadAndInitComctl32();
if (hpd->hComCtl32 == NULL)
{
goto Cleanup;
}
- /* initialize the common controls */
- pInitCommonControls = (PINITCOMMONCONTROLS)GetProcAddress(hpd->hComCtl32,
- "InitCommonControls");
- if (pInitCommonControls == NULL)
- {
- goto Cleanup;
- }
- pInitCommonControls();
-
/* create the dialog */
hWnd = CreateDialogParam(hDllInstance,
MAKEINTRESOURCE(IDD_HARDWARE),
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
STDCALL
DllMain(IN HINSTANCE hinstDLL,
LPARAM
ListViewGetSelectedItemData(IN HWND hwnd);
+LPWSTR
+ConvertMultiByteToUnicode(IN LPCSTR lpMultiByteStr,
+ IN UINT uCodePage);
+
+HINSTANCE
+LoadAndInitComctl32(VOID);
+
#endif /* __DEVMGR_H */
/* EOF */
}
-/***************************************************************************
- * 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
* DevicePropertiesExA