setupapi: Implement installing catalog files.

This commit is contained in:
Maarten Lankhorst 2008-10-14 22:31:15 +02:00 committed by Alexandre Julliard
parent 8cbc6f951f
commit c19b967cd8
2 changed files with 28 additions and 6 deletions

View file

@ -6,7 +6,7 @@ VPATH = @srcdir@
MODULE = setupapi.dll
IMPORTLIB = setupapi
IMPORTS = uuid user32 version advapi32 rpcrt4 kernel32 ntdll
DELAYIMPORTS = shell32
DELAYIMPORTS = shell32 wintrust
C_SRCS = \
devinst.c \

View file

@ -28,13 +28,14 @@
#include "winreg.h"
#include "setupapi.h"
#include "lzexpand.h"
#include "softpub.h"
#include "mscat.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "setupapi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
/* arbitrary limit not related to what native actually uses */
@ -1052,17 +1053,38 @@ BOOL WINAPI SetupCopyOEMInfW( PCWSTR source, PCWSTR location,
sizeof(catalog_file)/sizeof(catalog_file[0]), NULL ))
{
WCHAR source_cat[MAX_PATH];
strcpyW( source_cat, source );
HCATADMIN handle;
HCATINFO cat;
GUID msguid = DRIVER_ACTION_VERIFY;
SetupCloseInfFile( hinf );
strcpyW( source_cat, source );
p = strrchrW( source_cat, '\\' );
if (p) p++;
else p = source_cat;
strcpyW( p, catalog_file );
FIXME("install catalog file %s\n", debugstr_w( source_cat ));
TRACE("installing catalog file %s\n", debugstr_w( source_cat ));
if (!CryptCATAdminAcquireContext(&handle, &msguid, 0))
{
ERR("Could not acquire security context\n");
return FALSE;
}
if (!(cat = CryptCATAdminAddCatalog(handle, source_cat, catalog_file, 0)))
{
ERR("Could not add catalog\n");
CryptCATAdminReleaseContext(handle, 0);
return FALSE;
}
CryptCATAdminReleaseCatalogContext(handle, cat, 0);
CryptCATAdminReleaseContext(handle, 0);
}
SetupCloseInfFile( hinf );
else
SetupCloseInfFile( hinf );
if (!(ret = CopyFileW( source, target, (style & SP_COPY_NOOVERWRITE) != 0 )))
return ret;