HwDevInfo = (PHWDEVINFO)ListViewGetSelectedItemData(hpd->hWndDevList);
if (HwDevInfo != NULL)
{
- PWSTR szDeviceInstanceId = NULL;
- DWORD DeviceInstanceIdLen = 0;
-
- /* find out how much size is needed for the buffer */
- if (SetupDiGetDeviceInstanceId(HwDevInfo->ClassDevInfo->hDevInfo,
- &HwDevInfo->DevInfoData,
- NULL,
- 0,
- &DeviceInstanceIdLen))
- {
- DPRINT1("SetupDiGetDeviceInterfaceDetail unexpectedly returned TRUE!\n");
- goto Cleanup;
- }
-
- if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
- {
- goto Cleanup;
- }
-
- szDeviceInstanceId = HeapAlloc(GetProcessHeap(),
- 0,
- DeviceInstanceIdLen * sizeof(WCHAR));
- if (szDeviceInstanceId == NULL)
- {
- goto Cleanup;
- }
-
- /* read the device instance id */
- if (!SetupDiGetDeviceInstanceId(HwDevInfo->ClassDevInfo->hDevInfo,
- &HwDevInfo->DevInfoData,
- szDeviceInstanceId,
- DeviceInstanceIdLen,
- &DeviceInstanceIdLen))
- {
- goto Cleanup;
- }
-
- /* display the properties dialog */
- Ret = DeviceAdvancedProperties(hpd->hWnd,
- NULL,
- szDeviceInstanceId) >= 0;
-
-Cleanup:
- if (szDeviceInstanceId != NULL)
- {
- HeapFree(GetProcessHeap(),
- 0,
- szDeviceInstanceId);
- }
+ Ret = DisplayDeviceAdvancedProperties(hpd->hWnd,
+ HwDevInfo->ClassDevInfo->hDevInfo,
+ &HwDevInfo->DevInfoData,
+ hpd->hComCtl32) != -1;
}
return Ret;
if (HwDevInfo != NULL)
{
/* update static controls */
- CONFIGRET cRet;
- DWORD RegDataType;
- ULONG DataSize;
WCHAR szBuffer[256];
LPWSTR szFormatted = NULL;
/* get the manufacturer string */
- if (!SetupDiGetDeviceRegistryProperty(HwDevInfo->ClassDevInfo->hDevInfo,
- &HwDevInfo->DevInfoData,
- SPDRP_MFG,
- &RegDataType,
- (PBYTE)szBuffer,
- sizeof(szBuffer),
- NULL) ||
- RegDataType != REG_SZ)
- {
- szBuffer[0] = L'\0';
- LoadString(hDllInstance,
- IDS_UNKNOWN,
- szBuffer,
- sizeof(szBuffer) / sizeof(szBuffer[0]));
- }
- /* FIXME - check string for NULL termination! */
- if (LoadAndFormatString(hDllInstance,
+ if (GetDeviceManufacturerString(HwDevInfo->ClassDevInfo->hDevInfo,
+ &HwDevInfo->DevInfoData,
+ szBuffer,
+ sizeof(szBuffer) / sizeof(szBuffer[0])) &&
+ LoadAndFormatString(hDllInstance,
IDS_MANUFACTURER,
&szFormatted,
szBuffer) != 0)
}
/* get the location string */
- DataSize = sizeof(szBuffer);
- cRet = CM_Get_DevNode_Registry_Property(HwDevInfo->DevInfoData.DevInst,
- CM_DRP_LOCATION_INFORMATION,
- &RegDataType,
- szBuffer,
- &DataSize,
- 0);
- if (cRet != CR_SUCCESS ||
- RegDataType != REG_SZ)
- {
- szBuffer[0] = L'\0';
- LoadString(hDllInstance,
- IDS_UNKNOWN,
- szBuffer,
- sizeof(szBuffer) / sizeof(szBuffer[0]));
- }
- /* FIXME - check string for NULL termination! */
-
- if (szBuffer[0] >= L'0' && szBuffer[0] <= L'9')
- {
- /* convert the string to an integer value and create a
- formatted string */
- ULONG ulLocation = (ULONG)wcstoul(szBuffer,
- NULL,
- 10);
- if (LoadAndFormatString(hDllInstance,
- IDS_LOCATIONSTR,
- &szFormatted,
- ulLocation,
- szBuffer) != 0)
- {
- wcsncpy(szBuffer,
- szFormatted,
- (sizeof(szBuffer) / sizeof(szBuffer[0])) - 1);
- szBuffer[(sizeof(szBuffer) / sizeof(szBuffer[0])) - 1] = L'\0';
- LocalFree((HLOCAL)szFormatted);
- }
- }
-
- if (LoadAndFormatString(hDllInstance,
+ if (GetDeviceLocationString(HwDevInfo->DevInfoData.DevInst,
+ szBuffer,
+ sizeof(szBuffer) / sizeof(szBuffer[0])) &&
+ LoadAndFormatString(hDllInstance,
IDS_LOCATION,
&szFormatted,
szBuffer) != 0)
LocalFree((HLOCAL)szFormatted);
}
- /* FIXME - get the device status text */
- LoadString(hDllInstance,
- IDS_UNKNOWN,
- szBuffer,
- sizeof(szBuffer) / sizeof(szBuffer[0]));
-
- if (LoadAndFormatString(hDllInstance,
+ if (GetDeviceStatusString(HwDevInfo->ClassDevInfo->hDevInfo,
+ &HwDevInfo->DevInfoData,
+ szBuffer,
+ sizeof(szBuffer) / sizeof(szBuffer[0])) &&
+ LoadAndFormatString(hDllInstance,
IDS_STATUS,
&szFormatted,
szBuffer) != 0)
ItemCount++;
/* get the device type for the second column */
- if (SetupDiGetClassDescription(&ClassDevInfo->Guid,
- szBuffer,
- sizeof(szBuffer) / sizeof(szBuffer[0]),
- NULL))
+ if (GetDeviceTypeString(&HwDevInfo->DevInfoData,
+ szBuffer,
+ sizeof(szBuffer) / sizeof(szBuffer[0])))
{
li.mask = LVIF_TEXT;
li.iItem = iItem;
}
break;
}
+
+ case NM_DBLCLK:
+ {
+ DisplaySelectedDeviceProperties(hpd);
+ break;
+ }
}
}
break;
* RETURN VALUE
* Returns the handle of the hardware page window that has been created or
* NULL if it failed.
+ *
+ * @implemented
*/
HWND
WINAPI
* Returns the handle of the hardware page window that has been created or
* NULL if it failed.
*
- * REVISIONS
- *
- * NOTE
- *
+ * @implemented
*/
HWND
WINAPI