[ros-diffs] [hpoussin] 30324: Rename SETUP_DEV_INFO_SET_MAGIC to SETUP_DEVICE_INFO_SET_MAGIC Rename struct DeviceInfoElement to struct DeviceInfo Add a link to DeviceInfoSet in each DeviceInfo structure (not used yet)

hpoussin at svn.reactos.org hpoussin at svn.reactos.org
Sat Nov 10 15:04:55 CET 2007


Author: hpoussin
Date: Sat Nov 10 17:04:55 2007
New Revision: 30324

URL: http://svn.reactos.org/svn/reactos?rev=30324&view=rev
Log:
Rename SETUP_DEV_INFO_SET_MAGIC to SETUP_DEVICE_INFO_SET_MAGIC
Rename struct DeviceInfoElement to struct DeviceInfo
Add a link to DeviceInfoSet in each DeviceInfo structure (not used yet)

Modified:
    trunk/reactos/dll/win32/setupapi/devclass.c
    trunk/reactos/dll/win32/setupapi/devinst.c
    trunk/reactos/dll/win32/setupapi/driver.c
    trunk/reactos/dll/win32/setupapi/install.c
    trunk/reactos/dll/win32/setupapi/interface.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/devclass.c?rev=30324&r1=30323&r2=30324&view=diff
==============================================================================
--- trunk/reactos/dll/win32/setupapi/devclass.c (original)
+++ trunk/reactos/dll/win32/setupapi/devclass.c Sat Nov 10 17:04:55 2007
@@ -941,7 +941,7 @@
     WCHAR KeyBuffer[MAX_PATH];
     WCHAR InstancePath[MAX_PATH];
     LPWSTR pEndOfInstancePath; /* Pointer into InstancePath buffer */
-    struct DeviceInfoElement *deviceInfo;
+    struct DeviceInfo *deviceInfo;
     DWORD i = 0, j;
     DWORD dwLength, dwRegType;
     DWORD rc;
@@ -1026,7 +1026,7 @@
             }
 
             /* Add the entry to the list */
-            if (!CreateDeviceInfoElement(list, InstancePath, &KeyGuid, &deviceInfo))
+            if (!CreateDeviceInfo(list, InstancePath, &KeyGuid, &deviceInfo))
             {
                 rc = GetLastError();
                 goto cleanup;
@@ -1164,7 +1164,7 @@
     if (DeviceInfoSet)
     {
         list = (struct DeviceInfoSet *)DeviceInfoSet;
-        if (list->magic != SETUP_DEV_INFO_SET_MAGIC)
+        if (list->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         {
             SetLastError(ERROR_INVALID_HANDLE);
             goto cleanup;
@@ -2137,7 +2137,7 @@
     else
     {
         PSP_PROPCHANGE_PARAMS *CurrentPropChangeParams;
-        struct DeviceInfoElement *deviceInfo = (struct DeviceInfoElement *)DeviceInfoData->Reserved;
+        struct DeviceInfo *deviceInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
         CurrentPropChangeParams = &deviceInfo->ClassInstallParams.PropChangeParams;
 
         if (*CurrentPropChangeParams)
@@ -2188,7 +2188,7 @@
         }
         else
         {
-            struct DeviceInfoElement *deviceInfo = (struct DeviceInfoElement *)DeviceInfoData->Reserved;
+            struct DeviceInfo *deviceInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
             CurrentAddPropertyPageData = &deviceInfo->ClassInstallParams.AddPropertyPageData;
         }
         if (*CurrentAddPropertyPageData)
@@ -2233,7 +2233,7 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
         SetLastError(ERROR_INVALID_USER_BUFFER);
@@ -2372,9 +2372,9 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (!PropertySheetHeader)
         SetLastError(ERROR_INVALID_PARAMETER);

Modified: trunk/reactos/dll/win32/setupapi/devinst.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/devinst.c?rev=30324&r1=30323&r2=30324&view=diff
==============================================================================
--- trunk/reactos/dll/win32/setupapi/devinst.c (original)
+++ trunk/reactos/dll/win32/setupapi/devinst.c Sat Nov 10 17:04:55 2007
@@ -198,7 +198,7 @@
     }
     ZeroMemory(list, FIELD_OFFSET(struct DeviceInfoSet, szData));
 
-    list->magic = SETUP_DEV_INFO_SET_MAGIC;
+    list->magic = SETUP_DEVICE_INFO_SET_MAGIC;
     memcpy(
         &list->ClassGuid,
         ClassGuid ? ClassGuid : &GUID_NULL,
@@ -266,7 +266,7 @@
     {
         struct DeviceInfoSet *list = (struct DeviceInfoSet *)DeviceInfoSet;
 
-        if (list->magic != SETUP_DEV_INFO_SET_MAGIC)
+        if (list->magic != SETUP_DEVICE_INFO_SET_MAGIC)
             SetLastError(ERROR_INVALID_HANDLE);
         else if (DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
             SetLastError(ERROR_INVALID_USER_BUFFER);
@@ -279,7 +279,7 @@
                 SetLastError(ERROR_NO_MORE_ITEMS);
             else
             {
-                struct DeviceInfoElement *DevInfo = CONTAINING_RECORD(ItemList, struct DeviceInfoElement, ListEntry);
+                struct DeviceInfo *DevInfo = CONTAINING_RECORD(ItemList, struct DeviceInfo, ListEntry);
                 memcpy(&DeviceInfoData->ClassGuid,
                     &DevInfo->ClassGuid,
                     sizeof(GUID));
@@ -798,19 +798,19 @@
 
 
 BOOL
-CreateDeviceInfoElement(
+CreateDeviceInfo(
     IN struct DeviceInfoSet *list,
     IN LPCWSTR InstancePath,
     IN LPCGUID pClassGuid,
-    OUT struct DeviceInfoElement **pDeviceInfo)
+    OUT struct DeviceInfo **pDeviceInfo)
 {
     DWORD size;
     CONFIGRET cr;
-    struct DeviceInfoElement *deviceInfo;
+    struct DeviceInfo *deviceInfo;
 
     *pDeviceInfo = NULL;
 
-    size = FIELD_OFFSET(struct DeviceInfoElement, Data) + (strlenW(InstancePath) + 1) * sizeof(WCHAR);
+    size = FIELD_OFFSET(struct DeviceInfo, Data) + (strlenW(InstancePath) + 1) * sizeof(WCHAR);
     deviceInfo = HeapAlloc(GetProcessHeap(), 0, size);
     if (!deviceInfo)
     {
@@ -826,6 +826,7 @@
         return FALSE;
     }
 
+    deviceInfo->set = list;
     deviceInfo->InstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS_W);
     strcpyW(deviceInfo->Data, InstancePath);
     deviceInfo->DeviceName = deviceInfo->Data;
@@ -850,7 +851,7 @@
 }
 
 static BOOL
-DestroyDeviceInfoElement(struct DeviceInfoElement* deviceInfo)
+DestroyDeviceInfo(struct DeviceInfo *deviceInfo)
 {
     PLIST_ENTRY ListEntry;
     struct DriverInfoElement *driverInfo;
@@ -878,13 +879,13 @@
 DestroyDeviceInfoSet(struct DeviceInfoSet* list)
 {
     PLIST_ENTRY ListEntry;
-    struct DeviceInfoElement *deviceInfo;
+    struct DeviceInfo *deviceInfo;
 
     while (!IsListEmpty(&list->ListHead))
     {
         ListEntry = RemoveHeadList(&list->ListHead);
-        deviceInfo = CONTAINING_RECORD(ListEntry, struct DeviceInfoElement, ListEntry);
-        if (!DestroyDeviceInfoElement(deviceInfo))
+        deviceInfo = CONTAINING_RECORD(ListEntry, struct DeviceInfo, ListEntry);
+        if (!DestroyDeviceInfo(deviceInfo))
             return FALSE;
     }
     if (list->HKLM != HKEY_LOCAL_MACHINE)
@@ -908,7 +909,7 @@
     {
         struct DeviceInfoSet *list = (struct DeviceInfoSet *)DeviceInfoSet;
 
-        if (list->magic == SETUP_DEV_INFO_SET_MAGIC)
+        if (list->magic == SETUP_DEVICE_INFO_SET_MAGIC)
             ret = DestroyDeviceInfoSet(list);
         else
             SetLastError(ERROR_INVALID_HANDLE);
@@ -1030,7 +1031,7 @@
 
     if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (!DeviceInfoData)
         SetLastError(ERROR_INVALID_PARAMETER);
@@ -1041,7 +1042,7 @@
     else
     {
         struct DeviceInfoSet *list = (struct DeviceInfoSet *)DeviceInfoSet;
-        struct DeviceInfoElement *DevInfo = (struct DeviceInfoElement *)DeviceInfoData->Reserved;
+        struct DeviceInfo *DevInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
 
         switch (Property)
         {
@@ -1242,7 +1243,7 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (!DeviceInfoData)
         SetLastError(ERROR_INVALID_HANDLE);
@@ -1383,7 +1384,7 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (((struct DeviceInfoSet *)DeviceInfoSet)->HKLM != HKEY_LOCAL_MACHINE)
         SetLastError(ERROR_INVALID_HANDLE);
@@ -1737,7 +1738,7 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (IsEqualIID(&list->ClassGuid, &GUID_NULL))
         SetLastError(ERROR_NO_ASSOCIATED_CLASS);
@@ -1767,7 +1768,7 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (!DeviceInfoListDetailData)
         SetLastError(ERROR_INVALID_PARAMETER);
@@ -1851,7 +1852,7 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
         SetLastError(ERROR_INVALID_USER_BUFFER);
@@ -1864,7 +1865,7 @@
         PSP_DEVINSTALL_PARAMS_W Source;
 
         if (DeviceInfoData)
-            Source = &((struct DeviceInfoElement *)DeviceInfoData->Reserved)->InstallParams;
+            Source = &((struct DeviceInfo *)DeviceInfoData->Reserved)->InstallParams;
         else
             Source = &list->InstallParams;
         memcpy(DeviceInstallParams, Source, Source->cbSize);
@@ -1947,7 +1948,7 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
         SetLastError(ERROR_INVALID_USER_BUFFER);
@@ -1960,7 +1961,7 @@
         PSP_DEVINSTALL_PARAMS_W Destination;
 
         if (DeviceInfoData)
-            Destination = &((struct DeviceInfoElement *)DeviceInfoData->Reserved)->InstallParams;
+            Destination = &((struct DeviceInfo *)DeviceInfoData->Reserved)->InstallParams;
         else
             Destination = &list->InstallParams;
         memcpy(Destination, DeviceInstallParams, DeviceInstallParams->cbSize);
@@ -2036,7 +2037,7 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (!DeviceInfoData)
         SetLastError(ERROR_INVALID_PARAMETER);
@@ -2048,7 +2049,7 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else
     {
-        struct DeviceInfoElement *DevInfo = (struct DeviceInfoElement *)DeviceInfoData->Reserved;
+        struct DeviceInfo *DevInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
         DWORD required;
 
         required = (strlenW(DevInfo->DeviceName) + 1) * sizeof(WCHAR);
@@ -2183,7 +2184,7 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (!DeviceInfoData)
         SetLastError(ERROR_INVALID_PARAMETER);
@@ -2223,7 +2224,7 @@
 
         if (KeyType == DIREG_DEV)
         {
-            struct DeviceInfoElement *deviceInfo = (struct DeviceInfoElement *)DeviceInfoData->Reserved;
+            struct DeviceInfo *deviceInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
 
             rc = RegCreateKeyExW(
                 RootKey,
@@ -2384,7 +2385,7 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (!DeviceInfoData)
         SetLastError(ERROR_INVALID_PARAMETER);
@@ -2396,7 +2397,7 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else
     {
-        struct DeviceInfoElement *deviceInfo = (struct DeviceInfoElement *)DeviceInfoData->Reserved;
+        struct DeviceInfo *deviceInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
         LPWSTR DriverKey = NULL;
         DWORD dwLength = 0;
         DWORD dwRegType;
@@ -2577,7 +2578,7 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (!ClassGuid)
         SetLastError(ERROR_INVALID_PARAMETER);
@@ -2620,9 +2621,9 @@
             }
             else if (GetLastError() == ERROR_FILE_NOT_FOUND)
             {
-                struct DeviceInfoElement *deviceInfo;
-
-                if (CreateDeviceInfoElement(list, DeviceName, ClassGuid, &deviceInfo))
+                struct DeviceInfo *deviceInfo;
+
+                if (CreateDeviceInfo(list, DeviceName, ClassGuid, &deviceInfo))
                 {
                     InsertTailList(&list->ListHead, &deviceInfo->ListEntry);
 
@@ -2722,7 +2723,7 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (!DeviceInstanceId)
         SetLastError(ERROR_INVALID_PARAMETER);
@@ -2735,7 +2736,7 @@
         SetLastError(ERROR_INVALID_USER_BUFFER);
     else
     {
-        struct DeviceInfoElement *deviceInfo = NULL;
+        struct DeviceInfo *deviceInfo = NULL;
         /* Search if device already exists in DeviceInfoSet.
          *    If yes, return the existing element
          *    If no, create a new element using information in registry
@@ -2803,7 +2804,7 @@
                 UuidFromStringW(&szClassGuid[1], &ClassGUID);
             }
 
-            if (!CreateDeviceInfoElement(list, DeviceInstanceId, &ClassGUID, &deviceInfo))
+            if (!CreateDeviceInfo(list, DeviceInstanceId, &ClassGUID, &deviceInfo))
                 goto cleanup;
 
             InsertTailList(&list->ListHead, &deviceInfo->ListEntry);
@@ -2841,7 +2842,7 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (list->SelectedDevice == NULL)
         SetLastError(ERROR_NO_DEVICE_SELECTED);
@@ -2879,7 +2880,7 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (!DeviceInfoData)
         SetLastError(ERROR_INVALID_PARAMETER);
@@ -2889,7 +2890,7 @@
         SetLastError(ERROR_INVALID_USER_BUFFER);
     else
     {
-        list->SelectedDevice = (struct DeviceInfoElement *)DeviceInfoData->Reserved;
+        list->SelectedDevice = (struct DeviceInfo *)DeviceInfoData->Reserved;
         ret = TRUE;
     }
 
@@ -2955,7 +2956,7 @@
 {
 #ifndef __WINESRC__
     PLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData;
-    struct DeviceInfoElement *deviceInfo = (struct DeviceInfoElement *)DeviceInfoData->Reserved;
+    struct DeviceInfo *deviceInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
     NTSTATUS Status;
 
     if (((struct DeviceInfoSet *)DeviceInfoSet)->HKLM != HKEY_LOCAL_MACHINE)
@@ -3003,7 +3004,7 @@
     if (!DeviceInfoData)
         PropChange = ((struct DeviceInfoSet *)DeviceInfoSet)->ClassInstallParams.PropChangeParams;
     else
-        PropChange = ((struct DeviceInfoElement *)DeviceInfoData->Reserved)->ClassInstallParams.PropChangeParams;
+        PropChange = ((struct DeviceInfo *)DeviceInfoData->Reserved)->ClassInstallParams.PropChangeParams;
     if (!PropChange)
     {
         SetLastError(ERROR_INVALID_PARAMETER);
@@ -3125,7 +3126,7 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (!DeviceInfoData)
         SetLastError(ERROR_INVALID_PARAMETER);
@@ -3290,7 +3291,7 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
         SetLastError(ERROR_INVALID_USER_BUFFER);

Modified: trunk/reactos/dll/win32/setupapi/driver.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/driver.c?rev=30324&r1=30323&r2=30324&view=diff
==============================================================================
--- trunk/reactos/dll/win32/setupapi/driver.c (original)
+++ trunk/reactos/dll/win32/setupapi/driver.c Sat Nov 10 17:04:55 2007
@@ -737,7 +737,7 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (list->HKLM != HKEY_LOCAL_MACHINE)
         SetLastError(ERROR_INVALID_HANDLE);
@@ -759,7 +759,7 @@
 
         if (DeviceInfoData)
         {
-            struct DeviceInfoElement *devInfo = (struct DeviceInfoElement *)DeviceInfoData->Reserved;
+            struct DeviceInfo *devInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
             if (!(devInfo->CreationFlags & DICD_INHERIT_CLASSDRVS))
                 pDriverListHead = &devInfo->DriverListHead;
         }
@@ -789,7 +789,7 @@
             WCHAR InfFileName[MAX_PATH];
             WCHAR InfFileSection[MAX_PATH];
             ULONG RequiredSize;
-            struct DeviceInfoElement *devInfo = (struct DeviceInfoElement *)DeviceInfoData->Reserved;
+            struct DeviceInfo *devInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
             struct InfFileDetails *infFileDetails = NULL;
             FILETIME DriverDate;
             LONG rc;
@@ -1217,7 +1217,7 @@
 
     if (!DeviceInfoSet)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (DriverType != SPDIT_CLASSDRIVER && DriverType != SPDIT_COMPATDRIVER)
         SetLastError(ERROR_INVALID_PARAMETER);
@@ -1255,12 +1255,12 @@
         else
         {
             SP_DEVINSTALL_PARAMS_W InstallParamsSet;
-            struct DeviceInfoElement *deviceInfo;
+            struct DeviceInfo *deviceInfo;
 
             InstallParamsSet.cbSize = sizeof(SP_DEVINSTALL_PARAMS_W);
             if (!SetupDiGetDeviceInstallParamsW(DeviceInfoSet, NULL, &InstallParamsSet))
                 goto done;
-            deviceInfo = (struct DeviceInfoElement *)DeviceInfoData->Reserved;
+            deviceInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
             while (!IsListEmpty(&deviceInfo->DriverListHead))
             {
                  ListEntry = RemoveHeadList(&deviceInfo->DriverListHead);
@@ -1369,7 +1369,7 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (DriverType != SPDIT_CLASSDRIVER && DriverType != SPDIT_COMPATDRIVER)
         SetLastError(ERROR_INVALID_PARAMETER);
@@ -1379,10 +1379,10 @@
         SetLastError(ERROR_INVALID_USER_BUFFER);
     else
     {
-        struct DeviceInfoElement *devInfo = NULL;
+        struct DeviceInfo *devInfo = NULL;
         PLIST_ENTRY ItemList;
         if (DeviceInfoData)
-            devInfo = (struct DeviceInfoElement *)DeviceInfoData->Reserved;
+            devInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
         if (!devInfo || (devInfo->CreationFlags & DICD_INHERIT_CLASSDRVS))
         {
             ListHead = &((struct DeviceInfoSet *)DeviceInfoSet)->DriverListHead;
@@ -1489,7 +1489,7 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
         SetLastError(ERROR_INVALID_USER_BUFFER);
@@ -1600,7 +1600,7 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
         SetLastError(ERROR_INVALID_USER_BUFFER);
@@ -1613,8 +1613,8 @@
 
         if (DeviceInfoData)
         {
-            pDriverInfo = (struct DriverInfoElement **)&((struct DeviceInfoElement *)DeviceInfoData->Reserved)->InstallParams.Reserved;
-            ListHead = &((struct DeviceInfoElement *)DeviceInfoData->Reserved)->DriverListHead;
+            pDriverInfo = (struct DriverInfoElement **)&((struct DeviceInfo *)DeviceInfoData->Reserved)->InstallParams.Reserved;
+            ListHead = &((struct DeviceInfo *)DeviceInfoData->Reserved)->DriverListHead;
         }
         else
         {
@@ -1893,7 +1893,7 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
         SetLastError(ERROR_INVALID_USER_BUFFER);
@@ -2016,7 +2016,7 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
         SetLastError(ERROR_INVALID_USER_BUFFER);
@@ -2102,11 +2102,11 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
         SetLastError(ERROR_INVALID_USER_BUFFER);
-    else if (DeviceInfoData && ((struct DeviceInfoElement *)DeviceInfoData->Reserved)->InstallParams.Reserved == 0)
+    else if (DeviceInfoData && ((struct DeviceInfo *)DeviceInfoData->Reserved)->InstallParams.Reserved == 0)
         SetLastError(ERROR_NO_DRIVER_SELECTED);
     else if (!DeviceInfoData && ((struct DeviceInfoSet *)DeviceInfoSet)->InstallParams.Reserved == 0)
         SetLastError(ERROR_NO_DRIVER_SELECTED);

Modified: trunk/reactos/dll/win32/setupapi/install.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/install.c?rev=30324&r1=30323&r2=30324&view=diff
==============================================================================
--- trunk/reactos/dll/win32/setupapi/install.c (original)
+++ trunk/reactos/dll/win32/setupapi/install.c Sat Nov 10 17:04:55 2007
@@ -1878,7 +1878,7 @@
     }
     else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if (DeviceInfoSet && (list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if (DeviceInfoSet && (list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
         SetLastError(ERROR_INVALID_USER_BUFFER);

Modified: trunk/reactos/dll/win32/setupapi/interface.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/interface.c?rev=30324&r1=30323&r2=30324&view=diff
==============================================================================
--- trunk/reactos/dll/win32/setupapi/interface.c (original)
+++ trunk/reactos/dll/win32/setupapi/interface.c Sat Nov 10 17:04:55 2007
@@ -34,7 +34,7 @@
 
 static BOOL
 CreateDeviceInterface(
-    IN struct DeviceInfoElement* deviceInfo,
+    IN struct DeviceInfo* deviceInfo,
     IN LPCWSTR SymbolicLink,
     IN LPCGUID pInterfaceGuid,
     OUT struct DeviceInterface **pDeviceInterface)
@@ -89,7 +89,7 @@
     DWORD dwRegType;
     DWORD LinkedValue;
     GUID ClassGuid;
-    struct DeviceInfoElement *deviceInfo;
+    struct DeviceInfo *deviceInfo;
 
     hInterfaceKey = INVALID_HANDLE_VALUE;
     hDeviceInstanceKey = NULL;
@@ -223,7 +223,7 @@
 
             /* We have found a device */
             /* Step 1. Create a device info element */
-            if (!CreateDeviceInfoElement(list, InstancePath, &ClassGuid, &deviceInfo))
+            if (!CreateDeviceInfo(list, InstancePath, &ClassGuid, &deviceInfo))
             {
                 rc = GetLastError();
                 goto cleanup;
@@ -314,15 +314,15 @@
     {
         struct DeviceInfoSet *list = (struct DeviceInfoSet *)DeviceInfoSet;
 
-        if (list->magic == SETUP_DEV_INFO_SET_MAGIC)
+        if (list->magic == SETUP_DEVICE_INFO_SET_MAGIC)
         {
             PLIST_ENTRY ItemList = list->ListHead.Flink;
             BOOL Found = FALSE;
             while (ItemList != &list->ListHead && !Found)
             {
                 PLIST_ENTRY InterfaceListEntry;
-                struct DeviceInfoElement *DevInfo = CONTAINING_RECORD(ItemList, struct DeviceInfoElement, ListEntry);
-                if (DeviceInfoData && (struct DeviceInfoElement *)DeviceInfoData->Reserved != DevInfo)
+                struct DeviceInfo *DevInfo = CONTAINING_RECORD(ItemList, struct DeviceInfo, ListEntry);
+                if (DeviceInfoData && (struct DeviceInfo *)DeviceInfoData->Reserved != DevInfo)
                 {
                     /* We are not searching for this element */
                     ItemList = ItemList->Flink;
@@ -386,7 +386,7 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (DeviceInterfaceData->cbSize != sizeof(SP_DEVICE_INTERFACE_DATA))
         SetLastError(ERROR_INVALID_USER_BUFFER);
@@ -579,7 +579,7 @@
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE)
         SetLastError(ERROR_INVALID_HANDLE);
-    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
+    else if ((list = (struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEVICE_INFO_SET_MAGIC)
         SetLastError(ERROR_INVALID_HANDLE);
     else if (!DeviceInfoData)
         SetLastError(ERROR_INVALID_PARAMETER);

Modified: trunk/reactos/dll/win32/setupapi/setupapi_private.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupapi_private.h?rev=30324&r1=30323&r2=30324&view=diff
==============================================================================
--- trunk/reactos/dll/win32/setupapi/setupapi_private.h (original)
+++ trunk/reactos/dll/win32/setupapi/setupapi_private.h Sat Nov 10 17:04:55 2007
@@ -50,15 +50,15 @@
 #undef __WINESRC__
 #endif
 
-#define SETUP_DEV_INFO_SET_MAGIC 0xd00ff057
+#define SETUP_DEVICE_INFO_SET_MAGIC 0xd00ff057
 #define SETUP_CLASS_IMAGE_LIST_MAGIC 0xd00ff058
 
-struct DeviceInterface /* Element of DeviceInfoElement.InterfaceListHead */
+struct DeviceInterface /* Element of DeviceInfo.InterfaceListHead */
 {
     LIST_ENTRY ListEntry;
 
     /* Link to is parent device */
-    struct DeviceInfoElement* DeviceInfo;
+    struct DeviceInfo *DeviceInfo;
     GUID InterfaceClassGuid;
 
 
@@ -68,8 +68,8 @@
      */
     DWORD Flags;
 
-	/* Contains the symbolic link of this interface, for example
-	 * \\?\ACPI#PNP0501#4&2658d0a0&0#{GUID} */
+    /* Contains the symbolic link of this interface, for example
+     * \\?\ACPI#PNP0501#4&2658d0a0&0#{GUID} */
     WCHAR SymbolicLink[ANYSIZE_ARRAY];
 };
 
@@ -90,11 +90,11 @@
      * Points into szData at then end of the structure */
     PCWSTR FileName;
 
-	/* Variable size array (contains data for DirectoryName and FileName) */
+    /* Variable size array (contains data for DirectoryName and FileName) */
     WCHAR szData[ANYSIZE_ARRAY];
 };
 
-struct DriverInfoElement /* Element of DeviceInfoSet.DriverListHead and DeviceInfoElement.DriverListHead */
+struct DriverInfoElement /* Element of DeviceInfoSet.DriverListHead and DeviceInfo.DriverListHead */
 {
     LIST_ENTRY ListEntry;
 
@@ -113,11 +113,14 @@
     PSP_ADDPROPERTYPAGE_DATA AddPropertyPageData;
 };
 
-struct DeviceInfoElement /* Element of DeviceInfoSet.ListHead */
+struct DeviceInfo /* Element of DeviceInfoSet.ListHead */
 {
     LIST_ENTRY ListEntry;
     /* Used when dealing with CM_* functions */
     DEVINST dnDevInst;
+
+    /* Link to parent DeviceInfoSet */
+    struct DeviceInfoSet *set;
 
     /* Reserved Field of SP_DEVINSTALL_PARAMS_W structure
      * points to a struct DriverInfoElement */
@@ -164,13 +167,13 @@
     /* Used by SetupDiGetClassInstallParamsW/SetupDiSetClassInstallParamsW */
     struct ClassInstallParams ClassInstallParams;
 
-	/* Variable size array (contains data for DeviceName, UniqueId, DeviceDescription) */
+    /* Variable size array (contains data for DeviceName, UniqueId, DeviceDescription) */
     WCHAR Data[ANYSIZE_ARRAY];
 };
 
 struct DeviceInfoSet /* HDEVINFO */
 {
-    DWORD magic; /* SETUP_DEV_INFO_SET_MAGIC */
+    DWORD magic; /* SETUP_DEVICE_INFO_SET_MAGIC */
     /* If != GUID_NULL, only devices of this class can be in the device info set */
     GUID ClassGuid;
     /* Local or distant HKEY_LOCAL_MACHINE registry key */
@@ -185,9 +188,9 @@
      * searched/detected, this list is empty) */
     LIST_ENTRY DriverListHead;
 
-	/* List of struct DeviceInfoElement */
+    /* List of struct DeviceInfo */
     LIST_ENTRY ListHead;
-    struct DeviceInfoElement *SelectedDevice;
+    struct DeviceInfo *SelectedDevice;
 
     /* Used by SetupDiGetClassInstallParamsW/SetupDiSetClassInstallParamsW */
     struct ClassInstallParams ClassInstallParams;
@@ -266,11 +269,11 @@
 /* devinst.c */
 
 BOOL
-CreateDeviceInfoElement(
+CreateDeviceInfo(
     IN struct DeviceInfoSet *list,
     IN LPCWSTR InstancePath,
     IN LPCGUID pClassGuid,
-    OUT struct DeviceInfoElement **pDeviceInfo);
+    OUT struct DeviceInfo **pDeviceInfo);
 
 /* driver.c */
 




More information about the Ros-diffs mailing list