Rob Shearman : secur32: Fix the dwVersion field in the security function tables returned by InitSecurityInterfaceA /W.

Alexandre Julliard julliard at wine.codeweavers.com
Fri May 25 14:43:26 CDT 2007


Module: wine
Branch: master
Commit: 087eedc3f58dd7761de4832debc46bd57c16cd9b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=087eedc3f58dd7761de4832debc46bd57c16cd9b

Author: Rob Shearman <rob at codeweavers.com>
Date:   Thu May 24 13:05:28 2007 +0100

secur32: Fix the dwVersion field in the security function tables returned by InitSecurityInterfaceA/W.

---

 dlls/secur32/secur32.c       |    4 ++--
 dlls/secur32/tests/secur32.c |   38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/dlls/secur32/secur32.c b/dlls/secur32/secur32.c
index 421b115..aabb56c 100644
--- a/dlls/secur32/secur32.c
+++ b/dlls/secur32/secur32.c
@@ -86,7 +86,7 @@ static SecurePackageTable *packageTable = NULL;
 static SecureProviderTable *providerTable = NULL;
 
 static SecurityFunctionTableA securityFunctionTableA = {
-    SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2,
+    SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION,
     EnumerateSecurityPackagesA,
     QueryCredentialsAttributesA,
     AcquireCredentialsHandleA,
@@ -117,7 +117,7 @@ static SecurityFunctionTableA securityFunctionTableA = {
 };
 
 static SecurityFunctionTableW securityFunctionTableW = {
-    SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2,
+    SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION,
     EnumerateSecurityPackagesW,
     QueryCredentialsAttributesW,
     AcquireCredentialsHandleW,
diff --git a/dlls/secur32/tests/secur32.c b/dlls/secur32/tests/secur32.c
index 57f2ee1..99d5069 100644
--- a/dlls/secur32/tests/secur32.c
+++ b/dlls/secur32/tests/secur32.c
@@ -32,6 +32,8 @@ static HMODULE secdll;
 
 static BOOLEAN (WINAPI * pGetComputerObjectNameA)(EXTENDED_NAME_FORMAT NameFormat, LPSTR lpNameBuffer, PULONG lpnSize);
 static BOOLEAN (WINAPI * pGetComputerObjectNameW)(EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer, PULONG lpnSize);
+static PSecurityFunctionTableA (SEC_ENTRY * pInitSecurityInterfaceA)(void);
+static PSecurityFunctionTableW (SEC_ENTRY * pInitSecurityInterfaceW)(void);
 
 static EXTENDED_NAME_FORMAT formats[] = {
     NameUnknown, NameFullyQualifiedDN, NameSamCompatible, NameDisplay,
@@ -86,6 +88,38 @@ static void testGetComputerObjectNameW(void)
     }
 }
 
+static void test_InitSecurityInterface(void)
+{
+    PSecurityFunctionTableA sftA;
+    PSecurityFunctionTableW sftW;
+
+    sftA = pInitSecurityInterfaceA();
+    ok(sftA != NULL, "pInitSecurityInterfaceA failed\n");
+    ok(sftA->dwVersion == SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION, "wrong dwVersion %ld in security function table\n", sftA->dwVersion);
+    ok(!sftA->Reserved2, "Reserved2 should be NULL instead of %p in security function table\n", sftA->Reserved2);
+    todo_wine
+    ok(sftA->Reserved3 != NULL, "Reserved3 should not be NULL in security function table\n");
+    todo_wine
+    ok(sftA->Reserved4 != NULL, "Reserved4 should not be NULL in security function table\n");
+    ok(!sftA->Reserved8, "Reserved8 should be NULL instead of %p in security function table\n", sftA->Reserved8);
+
+    if (!pInitSecurityInterfaceW)
+    {
+        skip("InitSecurityInterfaceW not exported by secur32.dll\n");
+        return;
+    }
+
+    sftW = pInitSecurityInterfaceW();
+    ok(sftW != NULL, "pInitSecurityInterfaceW failed\n");
+    ok(sftW->dwVersion == SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION, "wrong dwVersion %ld in security function table\n", sftW->dwVersion);
+    ok(!sftW->Reserved2, "Reserved2 should be NULL instead of %p in security function table\n", sftW->Reserved2);
+    todo_wine
+    ok(sftW->Reserved3 != NULL, "Reserved3 should note be NULL in security function table\n");
+    todo_wine
+    ok(sftW->Reserved4 != NULL, "Reserved4 should not be NULL in security function table\n");
+    ok(!sftW->Reserved8, "Reserved8 should be NULL instead of %p in security function table\n", sftW->Reserved8);
+}
+
 START_TEST(secur32)
 {
     secdll = LoadLibraryA("secur32.dll");
@@ -97,6 +131,8 @@ START_TEST(secur32)
     {
         pGetComputerObjectNameA = (PVOID)GetProcAddress(secdll, "GetComputerObjectNameA");
         pGetComputerObjectNameW = (PVOID)GetProcAddress(secdll, "GetComputerObjectNameW");
+        pInitSecurityInterfaceA = (PVOID)GetProcAddress(secdll, "InitSecurityInterfaceA");
+        pInitSecurityInterfaceW = (PVOID)GetProcAddress(secdll, "InitSecurityInterfaceW");
  
         if (pGetComputerObjectNameA)
             testGetComputerObjectNameA();
@@ -104,6 +140,8 @@ START_TEST(secur32)
         if (pGetComputerObjectNameW)
             testGetComputerObjectNameW();
 
+        test_InitSecurityInterface();
+
         FreeLibrary(secdll);
     }
 }




More information about the wine-cvs mailing list