SetupDiGetDeviceRegistryProperty can work in win98?
-
msdn: Client Requires :Windows "Longhorn", Windows XP, Windows 2000 Professional, Windows Me, or Windows 98. Server Requires :Windows Server "Longhorn", Windows Server 2003, or Windows 2000 Server. ###what is different between client requires and server requires? that is meant it can work in win98 or can't? why the code can't work in win98: BOOL GetRegistryProperty(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, ULONG Property, PVOID Buffer, PULONG Length) { while (!SetupDiGetDeviceRegistryProperty(DeviceInfoSet, DeviceInfoData, Property, NULL, (PVOID)*(TCHAR **)Buffer, *Length, Length )) { if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) { // // We need to change the buffer size. // if (*(LPTSTR *)Buffer) LocalFree(*(LPTSTR *)Buffer); *(LPTSTR *)Buffer = LocalAlloc(LPTR,*Length); } else { // // Unknown Failure. // if (GetLastError() != ERROR_INVALID_DATA) { } return FALSE; } } return (*(LPTSTR *)Buffer)[0]; } here is the exception : if (*(LPTSTR *)Buffer) LocalFree(*(LPTSTR *)Buffer); *(LPTSTR *)Buffer = LocalAlloc(LPTR,*Length); thanks! -- modified at 9:43 Sunday 25th September, 2005