- Fix some error codes
authorHervé Poussineau <hpoussin@reactos.org>
Sun, 20 Nov 2005 20:19:05 +0000 (20:19 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Sun, 20 Nov 2005 20:19:05 +0000 (20:19 +0000)
- Add stubs for SetupDiGetClassImageList, SetupDiGetClassImageListExA/W, SetupDiDestroyClassImageList

svn path=/trunk/; revision=19386

reactos/lib/setupapi/devinst.c
reactos/lib/setupapi/setupapi.spec
reactos/lib/setupapi/stubs.c

index c8ddbcb..d5e6852 100644 (file)
@@ -2774,7 +2774,7 @@ HKEY WINAPI SetupDiOpenClassRegKeyExW(
     else
     {
         ERR("Invalid Flags parameter!\n");
-        SetLastError(ERROR_INVALID_PARAMETER);
+        SetLastError(ERROR_INVALID_FLAGS);
         return INVALID_HANDLE_VALUE;
     }
 
@@ -3805,7 +3805,7 @@ BOOL WINAPI SetupDiCreateDeviceInfoW(
     else if (CreationFlags & ~(DICD_GENERATE_ID | DICD_INHERIT_CLASSDRVS))
     {
         TRACE("Unknown flags: 0x%08lx\n", CreationFlags & ~(DICD_GENERATE_ID | DICD_INHERIT_CLASSDRVS));
-        SetLastError(ERROR_INVALID_PARAMETER);
+        SetLastError(ERROR_INVALID_FLAGS);
     }
     else
     {
@@ -4706,7 +4706,7 @@ SetupDiOpenDeviceInfoW(
     else if (OpenFlags & ~(DIOD_CANCEL_REMOVE | DIOD_INHERIT_CLASSDRVS))
     {
         TRACE("Unknown flags: 0x%08lx\n", OpenFlags & ~(DIOD_CANCEL_REMOVE | DIOD_INHERIT_CLASSDRVS));
-        SetLastError(ERROR_INVALID_PARAMETER);
+        SetLastError(ERROR_INVALID_FLAGS);
     }
     else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
         SetLastError(ERROR_INVALID_USER_BUFFER);
@@ -4755,6 +4755,8 @@ SetupDiOpenDeviceInfoW(
             RegCloseKey(hEnumKey);
             if (rc != ERROR_SUCCESS)
             {
+                if (rc == ERROR_FILE_NOT_FOUND)
+                    rc = ERROR_NO_SUCH_DEVINST;
                 SetLastError(rc);
                 return FALSE;
             }
index 41f97db..ea0a7df 100644 (file)
 @ stub SetupDiDeleteDevRegKey
 @ stdcall SetupDiDeleteDeviceInfo(long ptr)
 @ stub SetupDiDeleteDeviceInterfaceData
-@ stub SetupDiDestroyClassImageList
+@ stdcall SetupDiDestroyClassImageList(ptr)
 @ stdcall SetupDiDestroyDeviceInfoList(long)
 @ stdcall SetupDiDestroyDriverInfoList(long ptr long)
 @ stub SetupDiDrawMiniIcon
 @ stdcall SetupDiGetClassDevsExW(ptr wstr ptr long ptr wstr ptr)
 @ stdcall SetupDiGetClassDevsW(ptr ptr long long)
 @ stub SetupDiGetClassImageIndex
-@ stub SetupDiGetClassImageList
-@ stub SetupDiGetClassImageListExA
-@ stub SetupDiGetClassImageListExW
+@ stdcall SetupDiGetClassImageList(ptr)
+@ stdcall SetupDiGetClassImageListExA(ptr str ptr)
+@ stdcall SetupDiGetClassImageListExW(ptr wstr ptr)
 @ stub SetupDiGetClassInstallParamsA
 @ stub SetupDiGetClassInstallParamsW
 @ stub SetupDiGetDeviceInfoListClass
index a4768ee..bbd1481 100644 (file)
@@ -175,3 +175,48 @@ BOOL WINAPI SetupTerminateFileLog(HANDLE FileLogHandle)
     FIXME ("Stub %p\n",FileLogHandle);
     return TRUE;
 }
+
+
+/***********************************************************************
+ *             SetupDiGetClassImageList(SETUPAPI.@)
+ */
+BOOL WINAPI SetupDiGetClassImageList(PSP_CLASSIMAGELIST_DATA ClassImageListData)
+{
+    FIXME ("Stub %p\n", ClassImageListData);
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return FALSE;
+}
+
+
+/***********************************************************************
+ *             SetupDiGetClassImageListExA(SETUPAPI.@)
+ */
+BOOL WINAPI SetupDiGetClassImageListExA(PSP_CLASSIMAGELIST_DATA ClassImageListData,
+                                        PCSTR MachineName, PVOID Reserved)
+{
+    FIXME ("Stub %p %s %p\n", ClassImageListData, debugstr_a(MachineName), Reserved);
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return FALSE;
+}
+
+
+/***********************************************************************
+ *             SetupDiGetClassImageListExW(SETUPAPI.@)
+ */
+BOOL WINAPI SetupDiGetClassImageListExW(PSP_CLASSIMAGELIST_DATA ClassImageListData,
+                                        PCWSTR MachineName, PVOID Reserved)
+{
+    FIXME ("Stub %p %s %p\n", ClassImageListData, debugstr_w(MachineName), Reserved);
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return FALSE;
+}
+
+
+/***********************************************************************
+ *             SetupDiDestroyClassImageList(SETUPAPI.@)
+ */
+BOOL WINAPI SetupDiDestroyClassImageList(PSP_CLASSIMAGELIST_DATA ClassImageListData)
+{
+    FIXME ("Stub %p\n", ClassImageListData);
+    return TRUE;
+}