[setupapi]
[reactos.git] / reactos / dll / win32 / setupapi / install.c
index 5a6ad6c..6bc03be 100644 (file)
@@ -21,7 +21,8 @@
 
 #include "setupapi_private.h"
 
-WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
+#include <winsvc.h>
+#include <ndk/cmfuncs.h>
 
 /* Unicode constants */
 static const WCHAR BackSlash[] = {'\\',0};
@@ -1060,8 +1061,7 @@ profile_items_callback(
     if (SUCCEEDED(hr))
     {
         /* Fill link properties */
-        if (SUCCEEDED(hr))
-            hr = IShellLinkW_SetPath(psl, FullFileName);
+        hr = IShellLinkW_SetPath(psl, FullFileName);
         if (SUCCEEDED(hr))
             hr = IShellLinkW_SetArguments(psl, L"");
         if (SUCCEEDED(hr))
@@ -1814,6 +1814,10 @@ static BOOL InstallOneService(
     GetLineText(hInf, ServiceSection, DescriptionKey, &Description);
     GetLineText(hInf, ServiceSection, DependenciesKey, &Dependencies);
 
+    /* If there is no group, we must not request a tag */
+    if (!LoadOrderGroup || !*LoadOrderGroup)
+        useTag = FALSE;
+
     hService = OpenServiceW(
         hSCManager,
         ServiceName,
@@ -2169,6 +2173,7 @@ BOOL WINAPI SetupCopyOEMInfA(
     PWSTR DestinationInfFileNameW = NULL;
     PWSTR DestinationInfFileNameComponentW = NULL;
     BOOL ret = FALSE;
+    DWORD size;
 
     TRACE("%s %s 0x%lx 0x%lx %p 0%lu %p %p\n",
         SourceInfFileName, OEMSourceMediaLocation, OEMSourceMediaType,
@@ -2200,11 +2205,14 @@ BOOL WINAPI SetupCopyOEMInfA(
             CopyStyle,
             DestinationInfFileNameW,
             DestinationInfFileNameSize,
-            RequiredSize,
+            &size,
             DestinationInfFileNameComponent ? &DestinationInfFileNameComponentW : NULL);
         if (!ret)
+        {
+            if (RequiredSize) *RequiredSize = size;
             goto cleanup;
-
+        }
+            
         if (DestinationInfFileNameSize != 0)
         {
             if (WideCharToMultiByte(CP_ACP, 0, DestinationInfFileNameW, -1,
@@ -2280,8 +2288,6 @@ BOOL WINAPI SetupCopyOEMInfW(
         SetLastError(ERROR_INVALID_PARAMETER);
     else if (OEMSourceMediaType != SPOST_NONE && OEMSourceMediaType != SPOST_PATH && OEMSourceMediaType != SPOST_URL)
         SetLastError(ERROR_INVALID_PARAMETER);
-    else if (OEMSourceMediaType != SPOST_NONE && !OEMSourceMediaLocation)
-        SetLastError(ERROR_INVALID_PARAMETER);
     else if (CopyStyle & ~(SP_COPY_DELETESOURCE | SP_COPY_REPLACEONLY | SP_COPY_NOOVERWRITE | SP_COPY_OEMINF_CATALOG_ONLY))
     {
         TRACE("Unknown flags: 0x%08lx\n", CopyStyle & ~(SP_COPY_DELETESOURCE | SP_COPY_REPLACEONLY | SP_COPY_NOOVERWRITE | SP_COPY_OEMINF_CATALOG_ONLY));
@@ -2404,7 +2410,7 @@ BOOL WINAPI SetupCopyOEMInfW(
                     {
                         if (GetFileSizeEx(hDestFile, &DestFileSize)
                          && DestFileSize.QuadPart == SourceFileSize.QuadPart
-                         && compare_files(hSourceFile, hDestFile))
+                         && !compare_files(hSourceFile, hDestFile))
                         {
                             TRACE("%s already exists as %s\n",
                                 debugstr_w(SourceInfFileName), debugstr_w(pFileName));