Author: ekohl
Date: Sun Oct 12 17:13:36 2014
New Revision: 64700
URL:
http://svn.reactos.org/svn/reactos?rev=64700&view=rev
Log:
[SETUPAPI]
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.
Modified:
trunk/reactos/dll/win32/setupapi/devclass.c
trunk/reactos/dll/win32/setupapi/devinst.c
trunk/reactos/dll/win32/setupapi/setupapi_private.h
Modified: trunk/reactos/dll/win32/setupapi/devclass.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/devclas…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/devclass.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/devclass.c [iso-8859-1] Sun Oct 12 17:13:36 2014
@@ -1269,6 +1269,19 @@
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);
@@ -1299,7 +1312,6 @@
if (hKey != INVALID_HANDLE_VALUE)
RegCloseKey(hKey);
HeapFree(GetProcessHeap(), 0, PropPageProvider);
- FreeFunctionPointer(hModule, pPropPageProvider);
}
TRACE("Returning %d\n", ret);
Modified: trunk/reactos/dll/win32/setupapi/devinst.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/devinst…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] Sun Oct 12 17:13:36 2014
@@ -602,6 +602,8 @@
return FALSE;
}
DestroyClassInstallParams(&deviceInfo->ClassInstallParams);
+ if (deviceInfo->hmodDevicePropPageProvider)
+ FreeLibrary(deviceInfo->hmodDevicePropPageProvider);
return HeapFree(GetProcessHeap(), 0, deviceInfo);
}
@@ -622,6 +624,8 @@
RegCloseKey(list->HKLM);
CM_Disconnect_Machine(list->hMachine);
DestroyClassInstallParams(&list->ClassInstallParams);
+ if (list->hmodClassPropPageProvider)
+ FreeLibrary(list->hmodClassPropPageProvider);
return HeapFree(GetProcessHeap(), 0, list);
}
Modified: trunk/reactos/dll/win32/setupapi/setupapi_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupap…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/setupapi_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/setupapi_private.h [iso-8859-1] Sun Oct 12 17:13:36
2014
@@ -172,6 +172,10 @@
/* 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];
};
@@ -199,6 +203,10 @@
/* 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