[SYSSETUP]

* Add a way to register typelibs using the TypeLibraries section in syssetup.inf. Brought to you by Giannis Adamopoulos.

svn path=/trunk/; revision=59028
This commit is contained in:
Amine Khaldi 2013-05-17 21:40:46 +00:00
parent 5d953ac4b4
commit ce296e920c
4 changed files with 64 additions and 1 deletions

View file

@ -15,7 +15,7 @@ list(APPEND SOURCE
add_library(syssetup SHARED ${SOURCE}) add_library(syssetup SHARED ${SOURCE})
add_pch(syssetup precomp.h) add_pch(syssetup precomp.h)
set_module_type(syssetup win32dll UNICODE) set_module_type(syssetup win32dll UNICODE)
target_link_libraries(syssetup uuid ${PSEH_LIB}) target_link_libraries(syssetup uuid wine ${PSEH_LIB})
add_importlibs(syssetup add_importlibs(syssetup
msvcrt msvcrt

View file

@ -61,6 +61,8 @@ extern HINSTANCE hDllInstance;
extern HINF hSysSetupInf; extern HINF hSysSetupInf;
extern SETUPDATA SetupData; extern SETUPDATA SetupData;
BOOL RegisterTypeLibraries (HINF hinf, LPCWSTR szSection);
/* security.c */ /* security.c */
NTSTATUS SetAccountDomain(LPCWSTR DomainName, NTSTATUS SetAccountDomain(LPCWSTR DomainName,
PSID DomainSid); PSID DomainSid);

View file

@ -28,6 +28,8 @@
#include "precomp.h" #include "precomp.h"
#include <rpcproxy.h>
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
@ -393,6 +395,61 @@ InstallSysSetupInfComponents(VOID)
return TRUE; return TRUE;
} }
BOOL
RegisterTypeLibraries (HINF hinf, LPCWSTR szSection)
{
INFCONTEXT InfContext;
BOOL res;
WCHAR szName[MAX_PATH];
WCHAR szPath[MAX_PATH];
INT csidl;
LPWSTR p;
HMODULE hmod;
HRESULT hret;
/* Begin iterating the entries in the inf section */
res = SetupFindFirstLine(hinf, szSection, NULL, &InfContext);
if (!res) return FALSE;
do
{
/* Get the name of the current type library */
if (!SetupGetStringFieldW(&InfContext, 1, szName, MAX_PATH, NULL))
{
FatalError("SetupGetStringFieldW failed\n");
continue;
}
if (!SetupGetIntField(&InfContext, 2, &csidl))
csidl = CSIDL_SYSTEM;
hret = SHGetFolderPathW(NULL, csidl, NULL, 0, szPath);
if (FAILED(hret))
{
FatalError("SHGetSpecialFolderPathW failed hret=0x%d\n", hret);
continue;
}
p = PathAddBackslash(szPath);
_tcscpy(p, szName);
hmod = LoadLibraryW(szName);
if (hmod == NULL)
{
FatalError("LoadLibraryW failed\n");
continue;
}
__wine_register_resources(hmod);
}while (SetupFindNextLine(&InfContext, &InfContext));
return TRUE;
}
static BOOL static BOOL
EnableUserModePnpManager(VOID) EnableUserModePnpManager(VOID)
{ {
@ -668,6 +725,8 @@ InstallLiveCD(IN HINSTANCE hInstance)
{ {
DPRINT1("SetupInstallFromInfSectionW failed!\n"); DPRINT1("SetupInstallFromInfSectionW failed!\n");
} }
RegisterTypeLibraries(hSysSetupInf, L"TypeLibraries");
} }
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{ {

View file

@ -1685,6 +1685,8 @@ RegistrationProc(LPVOID Parameter)
SetupTermDefaultQueueCallback(RegistrationData->DefaultContext); SetupTermDefaultQueueCallback(RegistrationData->DefaultContext);
HeapFree(GetProcessHeap(), 0, RegistrationData); HeapFree(GetProcessHeap(), 0, RegistrationData);
RegisterTypeLibraries(hSysSetupInf, L"TypeLibraries");
// FIXME: Move this call to a separate cleanup page! // FIXME: Move this call to a separate cleanup page!
RtlCreateBootStatusDataFile(); RtlCreateBootStatusDataFile();