Author: cwittich
Date: Sun May 11 19:44:50 2014
New Revision: 63240
URL:
http://svn.reactos.org/svn/reactos?rev=63240&view=rev
Log:
[setupapi]
-sync pSetupInstallCatalog to wine
-only return RequiredSize in SetupCopyOEMInfA on failure
Modified:
trunk/reactos/dll/win32/setupapi/CMakeLists.txt
trunk/reactos/dll/win32/setupapi/install.c
trunk/reactos/dll/win32/setupapi/misc.c
trunk/reactos/dll/win32/setupapi/setupapi.spec
trunk/reactos/dll/win32/setupapi/setupapi_private.h
Modified: trunk/reactos/dll/win32/setupapi/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/CMakeLi…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/CMakeLists.txt [iso-8859-1] Sun May 11 19:44:50 2014
@@ -40,7 +40,7 @@
set_module_type(setupapi win32dll UNICODE)
target_link_libraries(setupapi uuid wine ${PSEH_LIB})
-add_delay_importlibs(setupapi shell32)
+add_delay_importlibs(setupapi shell32 wintrust)
add_importlibs(setupapi
msvcrt
Modified: trunk/reactos/dll/win32/setupapi/install.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/install…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/install.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/install.c [iso-8859-1] Sun May 11 19:44:50 2014
@@ -2173,6 +2173,7 @@
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,
@@ -2204,11 +2205,14 @@
CopyStyle,
DestinationInfFileNameW,
DestinationInfFileNameSize,
- RequiredSize,
+ &size,
DestinationInfFileNameComponent ? &DestinationInfFileNameComponentW :
NULL);
if (!ret)
- goto cleanup;
-
+ {
+ if (RequiredSize) *RequiredSize = size;
+ goto cleanup;
+ }
+
if (DestinationInfFileNameSize != 0)
{
if (WideCharToMultiByte(CP_ACP, 0, DestinationInfFileNameW, -1,
Modified: trunk/reactos/dll/win32/setupapi/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/misc.c?…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/misc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/misc.c [iso-8859-1] Sun May 11 19:44:50 2014
@@ -1215,6 +1215,34 @@
{
FIXME("%s, %s, %p\n", debugstr_a(catalog), debugstr_a(basename),
fullname);
return 0;
+}
+
+/***********************************************************************
+ * pSetupInstallCatalog (SETUPAPI.@)
+ */
+DWORD WINAPI pSetupInstallCatalog( LPCWSTR catalog, LPCWSTR basename, LPWSTR fullname )
+{
+ HCATADMIN admin;
+ HCATINFO cat;
+
+ TRACE ("%s, %s, %p\n", debugstr_w(catalog), debugstr_w(basename),
fullname);
+
+ if (!CryptCATAdminAcquireContext(&admin,NULL,0))
+ return GetLastError();
+
+ if (!(cat = CryptCATAdminAddCatalog( admin, (PWSTR)catalog, (PWSTR)basename, 0 )))
+ {
+ DWORD rc = GetLastError();
+ CryptCATAdminReleaseContext(admin, 0);
+ return rc;
+ }
+ CryptCATAdminReleaseCatalogContext(admin, cat, 0);
+ CryptCATAdminReleaseContext(admin,0);
+
+ if (fullname)
+ FIXME("not returning full installed catalog path\n");
+
+ return NO_ERROR;
}
static UINT detect_compression_type( LPCWSTR file )
@@ -1536,26 +1564,29 @@
return ret;
}
+struct callback_context
+{
+ BOOL has_extracted;
+ LPCWSTR target;
+};
+
static UINT CALLBACK decompress_or_copy_callback( PVOID context, UINT notification,
UINT_PTR param1, UINT_PTR param2 )
{
+ struct callback_context *context_info = context;
FILE_IN_CABINET_INFO_W *info = (FILE_IN_CABINET_INFO_W *)param1;
switch (notification)
{
case SPFILENOTIFY_FILEINCABINET:
{
- LPCWSTR filename, targetname = context;
- WCHAR *p;
-
- if ((p = strrchrW( targetname, '\\' ))) filename = p + 1;
- else filename = targetname;
-
- if (!lstrcmpiW( filename, info->NameInCabinet ))
- {
- strcpyW( info->FullTargetName, targetname );
- return FILEOP_DOIT;
- }
- return FILEOP_SKIP;
+ if (context_info->has_extracted)
+ return FILEOP_ABORT;
+
+ TRACE("Requesting extraction of cabinet file %s\n",
+ wine_dbgstr_w(info->NameInCabinet));
+ strcpyW( info->FullTargetName, context_info->target );
+ context_info->has_extracted = TRUE;
+ return FILEOP_DOIT;
}
default: return NO_ERROR;
}
@@ -1563,9 +1594,10 @@
static DWORD decompress_file_cab( LPCWSTR source, LPCWSTR target )
{
+ struct callback_context context = {0, target};
BOOL ret;
- ret = SetupIterateCabinetW( source, 0, decompress_or_copy_callback, (PVOID)target );
+ ret = SetupIterateCabinetW( source, 0, decompress_or_copy_callback, &context );
if (ret) return ERROR_SUCCESS;
else return GetLastError();
@@ -1578,7 +1610,7 @@
*/
DWORD WINAPI SetupDecompressOrCopyFileA( PCSTR source, PCSTR target, PUINT type )
{
- DWORD ret = FALSE;
+ DWORD ret = 0;
WCHAR *sourceW = NULL, *targetW = NULL;
if (source && !(sourceW = pSetupMultiByteToUnicode( source, CP_ACP ))) return
FALSE;
Modified: trunk/reactos/dll/win32/setupapi/setupapi.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupap…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] Sun May 11 19:44:50 2014
@@ -562,7 +562,7 @@
@ stub pSetupHandleFailedVerification
@ stub pSetupInfCacheBuild
@ stub pSetupInfIsFromOemLocation
-@ stub pSetupInstallCatalog
+@ stdcall pSetupInstallCatalog(wstr wstr ptr)
@ stub pSetupInstallStopEx
@ stdcall pSetupIsGuidNull(ptr)
@ stub pSetupIsLocalSystem
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 May 11 19:44:50
2014
@@ -37,6 +37,8 @@
#include <regstr.h>
#include <sddl.h>
#include <setupapi.h>
+#include <softpub.h>
+#include <mscat.h>
#include <shlobj.h>
#include <wine/unicode.h>
#define NTOS_MODE_USER