[SETUPAPI]
[reactos.git] / reactos / dll / win32 / setupapi / install.c
index 0d1fd06..b6eae76 100644 (file)
@@ -998,7 +998,7 @@ profile_items_callback(
     }
     else
     {
-        FullIconName = DuplicateString(FullFileName);
+        FullIconName = pSetupDuplicateString(FullFileName);
         if (!FullIconName)
             goto cleanup;
     }
@@ -1060,8 +1060,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 +1813,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,
@@ -2177,9 +2180,9 @@ BOOL WINAPI SetupCopyOEMInfA(
 
     if (!DestinationInfFileName && DestinationInfFileNameSize > 0)
         SetLastError(ERROR_INVALID_PARAMETER);
-    else if (!(SourceInfFileNameW = MultiByteToUnicode(SourceInfFileName, CP_ACP)))
+    else if (!(SourceInfFileNameW = pSetupMultiByteToUnicode(SourceInfFileName, CP_ACP)))
         SetLastError(ERROR_INVALID_PARAMETER);
-    else if (OEMSourceMediaType != SPOST_NONE && !(OEMSourceMediaLocationW = MultiByteToUnicode(OEMSourceMediaLocation, CP_ACP)))
+    else if (OEMSourceMediaType != SPOST_NONE && !(OEMSourceMediaLocationW = pSetupMultiByteToUnicode(OEMSourceMediaLocation, CP_ACP)))
         SetLastError(ERROR_INVALID_PARAMETER);
     else
     {
@@ -2280,8 +2283,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 +2405,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));