Commit d42a601b authored by Zhangrong Huang's avatar Zhangrong Huang Committed by Alexandre Julliard

secur32: Allow loading external schannel.dll.

parent 746cdb4a
......@@ -358,11 +358,12 @@ static const SecurityFunctionTableW schanTableW = {
static const WCHAR schannelComment[] = { 'S','c','h','a','n','n','e','l',' ',
'S','e','c','u','r','i','t','y',' ','P','a','c','k','a','g','e',0 };
static const WCHAR schannelDllName[] = { 's','c','h','a','n','n','e','l','.','d','l','l',0 };
void SECUR32_initSchannelSP(void)
{
SecureProvider *provider = SECUR32_addProvider(&schanTableA, &schanTableW,
NULL);
schannelDllName);
if (provider)
{
......
......@@ -419,10 +419,10 @@ SecureProvider *SECUR32_addProvider(const SecurityFunctionTableA *fnTableA,
if (fnTableA || fnTableW)
{
ret->moduleName = NULL;
ret->moduleName = moduleName ? SECUR32_strdupW(moduleName) : NULL;
_makeFnTableA(&ret->fnTableA, fnTableA, fnTableW);
_makeFnTableW(&ret->fnTableW, fnTableA, fnTableW);
ret->loaded = TRUE;
ret->loaded = moduleName ? FALSE : TRUE;
}
else
{
......@@ -505,9 +505,19 @@ static void _tryLoadProvider(PWSTR moduleName)
if (pInitSecurityInterfaceW)
fnTableW = pInitSecurityInterfaceW();
if (fnTableW && fnTableW->EnumerateSecurityPackagesW)
{
if (fnTableW != &securityFunctionTableW)
ret = fnTableW->EnumerateSecurityPackagesW(&toAdd, &infoW);
else
TRACE("%s has built-in providers, skip adding\n", debugstr_w(moduleName));
}
else if (fnTableA && fnTableA->EnumerateSecurityPackagesA)
{
if (fnTableA != &securityFunctionTableA)
ret = fnTableA->EnumerateSecurityPackagesA(&toAdd, &infoA);
else
TRACE("%s has built-in providers, skip adding\n", debugstr_w(moduleName));
}
if (ret == SEC_E_OK && toAdd > 0 && (infoW || infoA))
{
SecureProvider *provider = SECUR32_addProvider(NULL, NULL,
......@@ -624,7 +634,10 @@ SecurePackage *SECUR32_findPackageW(PCWSTR packageName)
fnTableA = pInitSecurityInterfaceA();
if (pInitSecurityInterfaceW)
fnTableW = pInitSecurityInterfaceW();
/* dont't update built-in SecurityFunctionTable */
if (fnTableA != &securityFunctionTableA)
_makeFnTableA(&ret->provider->fnTableA, fnTableA, fnTableW);
if (fnTableW != &securityFunctionTableW)
_makeFnTableW(&ret->provider->fnTableW, fnTableA, fnTableW);
ret->provider->loaded = TRUE;
}
......
......@@ -89,7 +89,8 @@ typedef enum _sign_direction {
} SignDirection;
/* Allocates space for and initializes a new provider. If fnTableA or fnTableW
* is non-NULL, assumes the provider is built-in (and is thus already loaded.)
* is non-NULL, assumes the provider is built-in, and if moduleName is non-NULL,
* means must load the LSA/user mode functions tables from external SSP/AP module.
* Otherwise moduleName must not be NULL.
* Returns a pointer to the stored provider entry, for use adding packages.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment