Store the module handles to loaded property page provider dlls in the DeviceInfoData (for class property pages) or in the DeviceInfo (for device property pages). The dlls are unloaded when the device info set is destroyed. These dlls were unloaded as soon as the property sheet data had been retrieved. These property pages could not be added to a property sheet because unloading the dll invalidated the page reources.
svn path=/trunk/; revision=64700
goto cleanup;
}
+ if (DeviceInfoData)
+ {
+ struct DeviceInfo *devInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
+ devInfo->hmodDevicePropPageProvider = hModule;
+ devInfo->pDevicePropPageProvider = pPropPageProvider;
+ }
+ else
+ {
+ struct DeviceInfoSet *devInfoSet = (struct DeviceInfoSet *)DeviceInfoSet;
+ devInfoSet->hmodClassPropPageProvider = hModule;
+ devInfoSet->pClassPropPageProvider = pPropPageProvider;
+ }
+
InitialNumberOfPages = PropertySheetHeader->nPages;
Request.cbSize = sizeof(SP_PROPSHEETPAGE_REQUEST);
if (hKey != INVALID_HANDLE_VALUE)
RegCloseKey(hKey);
HeapFree(GetProcessHeap(), 0, PropPageProvider);
- FreeFunctionPointer(hModule, pPropPageProvider);
}
TRACE("Returning %d\n", ret);
return FALSE;
}
DestroyClassInstallParams(&deviceInfo->ClassInstallParams);
+ if (deviceInfo->hmodDevicePropPageProvider)
+ FreeLibrary(deviceInfo->hmodDevicePropPageProvider);
return HeapFree(GetProcessHeap(), 0, deviceInfo);
}
RegCloseKey(list->HKLM);
CM_Disconnect_Machine(list->hMachine);
DestroyClassInstallParams(&list->ClassInstallParams);
+ if (list->hmodClassPropPageProvider)
+ FreeLibrary(list->hmodClassPropPageProvider);
return HeapFree(GetProcessHeap(), 0, list);
}
/* Used by SetupDiGetClassInstallParamsW/SetupDiSetClassInstallParamsW */
struct ClassInstallParams ClassInstallParams;
+ /* Device property page provider data */
+ HMODULE hmodDevicePropPageProvider;
+ PVOID pDevicePropPageProvider;
+
/* Variable size array (contains data for instanceId, UniqueId, DeviceDescription) */
WCHAR Data[ANYSIZE_ARRAY];
};
/* Used by SetupDiGetClassInstallParamsW/SetupDiSetClassInstallParamsW */
struct ClassInstallParams ClassInstallParams;
+ /* Class property page provider data */
+ HMODULE hmodClassPropPageProvider;
+ PVOID pClassPropPageProvider;
+
/* Contains the name of the remote computer ('\\COMPUTERNAME' for example),
* or NULL if related to local machine. Points into szData field at the
* end of the structure */