include: sspi.h: Use the Win types as per MSDN.

Michael Stefaniuc mstefani at redhat.de
Mon Jan 5 17:06:04 CST 2009


This improves the Win64 compatibility.
---
 dlls/rpcrt4/rpc_message.c    |    2 +-
 dlls/schannel/tests/main.c   |    8 ++--
 dlls/secur32/ntlm.c          |    2 +-
 dlls/secur32/tests/ntlm.c    |   14 +++---
 dlls/secur32/tests/secur32.c |    4 +-
 include/sspi.h               |   94 +++++++++++++++++++++---------------------
 6 files changed, 62 insertions(+), 62 deletions(-)

diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c
index 72f73b9..155d7ec 100644
--- a/dlls/rpcrt4/rpc_message.c
+++ b/dlls/rpcrt4/rpc_message.c
@@ -606,7 +606,7 @@ static RPC_STATUS RPCRT4_ClientAuthorize(RpcConnection *conn, SecBuffer *in,
       }
   }
 
-  TRACE("cbBuffer = %ld\n", out->cbBuffer);
+  TRACE("cbBuffer = %d\n", out->cbBuffer);
 
   if (!continue_needed)
   {
diff --git a/dlls/schannel/tests/main.c b/dlls/schannel/tests/main.c
index 5575cc1..9492a97 100644
--- a/dlls/schannel/tests/main.c
+++ b/dlls/schannel/tests/main.c
@@ -144,13 +144,13 @@ static void testGetInfo(void)
     /* First package: Unified */
     status = pTables->GetInfo(&PackageInfo);
     ok(status == STATUS_SUCCESS, "status: 0x%x\n", status);
-    ok(PackageInfo.fCapabilities == 0x107b3, "fCapabilities: 0x%lx\n",
+    ok(PackageInfo.fCapabilities == 0x107b3, "fCapabilities: 0x%x\n",
        PackageInfo.fCapabilities);
     ok(PackageInfo.wVersion == 1, "wVersion: %d\n", PackageInfo.wVersion);
     ok(PackageInfo.wRPCID == 14, "wRPCID: %d\n", PackageInfo.wRPCID);
     ok(PackageInfo.cbMaxToken == 0x4000 ||
        PackageInfo.cbMaxToken == 0x6000, /* Vista */
-       "cbMaxToken: 0x%lx\n",
+       "cbMaxToken: 0x%x\n",
        PackageInfo.cbMaxToken);
 
     /* Second package: SChannel */
@@ -164,11 +164,11 @@ static void testGetInfo(void)
 
     if (status == STATUS_SUCCESS)
     {
-        ok(PackageInfo.fCapabilities == 0x107b3, "fCapabilities: 0x%lx\n",
+        ok(PackageInfo.fCapabilities == 0x107b3, "fCapabilities: 0x%x\n",
            PackageInfo.fCapabilities);
         ok(PackageInfo.wVersion == 1, "wVersion: %d\n", PackageInfo.wVersion);
         ok(PackageInfo.wRPCID == 14, "wRPCID: %d\n", PackageInfo.wRPCID);
-        ok(PackageInfo.cbMaxToken == 0x4000, "cbMaxToken: 0x%lx\n",
+        ok(PackageInfo.cbMaxToken == 0x4000, "cbMaxToken: 0x%x\n",
            PackageInfo.cbMaxToken);
     }
 }
diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c
index f2b8b2a..bc44a45 100644
--- a/dlls/secur32/ntlm.c
+++ b/dlls/secur32/ntlm.c
@@ -768,7 +768,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW(
 
         if(pInput->pBuffers[input_token_idx].cbBuffer > max_len)
         {
-            TRACE("pInput->pBuffers[%d].cbBuffer is: %ld\n",
+            TRACE("pInput->pBuffers[%d].cbBuffer is: %d\n",
                     input_token_idx,
                     pInput->pBuffers[input_token_idx].cbBuffer);
             ret = SEC_E_INVALID_TOKEN;
diff --git a/dlls/secur32/tests/ntlm.c b/dlls/secur32/tests/ntlm.c
index 4667ef0..370a714 100644
--- a/dlls/secur32/tests/ntlm.c
+++ b/dlls/secur32/tests/ntlm.c
@@ -447,7 +447,7 @@ static SECURITY_STATUS runClient(SspiData *sspi_data, BOOL first, ULONG data_rep
         ok(ret == SEC_E_BUFFER_TOO_SMALL, "expected SEC_E_BUFFER_TOO_SMALL, got %s\n", getSecError(ret));
 
         ok(out_buf->pBuffers[0].cbBuffer == 0,
-           "InitializeSecurityContext set buffer size to %lu\n", out_buf->pBuffers[0].cbBuffer);
+           "InitializeSecurityContext set buffer size to %u\n", out_buf->pBuffers[0].cbBuffer);
 
         out_buf->pBuffers[0].cbBuffer = sspi_data->max_token;
         out_buf->pBuffers[0].BufferType = SECBUFFER_DATA;
@@ -476,9 +476,9 @@ static SECURITY_STATUS runClient(SspiData *sspi_data, BOOL first, ULONG data_rep
     }
 
     ok(out_buf->pBuffers[0].BufferType == SECBUFFER_TOKEN,
-       "buffer type was changed from SECBUFFER_TOKEN to %ld\n", out_buf->pBuffers[0].BufferType);
+       "buffer type was changed from SECBUFFER_TOKEN to %d\n", out_buf->pBuffers[0].BufferType);
     ok(out_buf->pBuffers[0].cbBuffer < sspi_data->max_token,
-       "InitializeSecurityContext set buffer size to %lu\n", out_buf->pBuffers[0].cbBuffer);
+       "InitializeSecurityContext set buffer size to %u\n", out_buf->pBuffers[0].cbBuffer);
 
     return ret;
 }
@@ -870,16 +870,16 @@ static void testAuth(ULONG data_rep, BOOL fake)
             "pQueryContextAttributesA(SECPKG_ATTR_SIZES) returned %s\n",
             getSecError(sec_status));
     ok((ctxt_sizes.cbMaxToken == 1904) || (ctxt_sizes.cbMaxToken == 2888),
-            "cbMaxToken should be 1904 or 2888 but is %lu\n",
+            "cbMaxToken should be 1904 or 2888 but is %u\n",
             ctxt_sizes.cbMaxToken);
     ok(ctxt_sizes.cbMaxSignature == 16,
-            "cbMaxSignature should be 16 but is %lu\n",
+            "cbMaxSignature should be 16 but is %u\n",
             ctxt_sizes.cbMaxSignature);
     ok(ctxt_sizes.cbSecurityTrailer == 16,
-            "cbSecurityTrailer should be 16 but is  %lu\n",
+            "cbSecurityTrailer should be 16 but is  %u\n",
             ctxt_sizes.cbSecurityTrailer);
     ok(ctxt_sizes.cbBlockSize == 0,
-            "cbBlockSize should be 0 but is %lu\n",
+            "cbBlockSize should be 0 but is %u\n",
             ctxt_sizes.cbBlockSize);
 
 tAuthend:
diff --git a/dlls/secur32/tests/secur32.c b/dlls/secur32/tests/secur32.c
index 5bdb914..39edeea 100644
--- a/dlls/secur32/tests/secur32.c
+++ b/dlls/secur32/tests/secur32.c
@@ -101,7 +101,7 @@ static void test_InitSecurityInterface(void)
 
     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->dwVersion == SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION, "wrong dwVersion %d in security function table\n", sftA->dwVersion);
     ok(!sftA->Reserved2, "Reserved2 should be NULL instead of %p in security function table\n", sftA->Reserved2);
     ok(sftA->Reserved3 == sftA->EncryptMessage, "Reserved3 should be equal to EncryptMessage in the security function table\n");
     ok(sftA->Reserved4 == sftA->DecryptMessage, "Reserved4 should be equal to DecryptMessage in the security function table\n");
@@ -114,7 +114,7 @@ static void test_InitSecurityInterface(void)
 
     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->dwVersion == SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION, "wrong dwVersion %d in security function table\n", sftW->dwVersion);
     ok(!sftW->Reserved2, "Reserved2 should be NULL instead of %p in security function table\n", sftW->Reserved2);
     ok(sftW->Reserved3 == sftW->EncryptMessage, "Reserved3 should be equal to EncryptMessage in the security function table\n");
     ok(sftW->Reserved4 == sftW->DecryptMessage, "Reserved4 should be equal to DecryptMessage in the security function table\n");
diff --git a/include/sspi.h b/include/sspi.h
index 29eda33..9a7134f 100644
--- a/include/sspi.h
+++ b/include/sspi.h
@@ -89,22 +89,22 @@ typedef UNICODE_STRING SECURITY_STRING, *PSECURITY_STRING;
 
 typedef struct _SecPkgInfoA
 {
-    unsigned long  fCapabilities;
-    unsigned short wVersion;
-    unsigned short wRPCID;
-    unsigned long  cbMaxToken;
-    SEC_CHAR      *Name;
-    SEC_CHAR      *Comment;
+    ULONG     fCapabilities;
+    USHORT    wVersion;
+    USHORT    wRPCID;
+    ULONG     cbMaxToken;
+    SEC_CHAR *Name;
+    SEC_CHAR *Comment;
 } SecPkgInfoA, *PSecPkgInfoA;
 
 typedef struct _SecPkgInfoW
 {
-    unsigned long  fCapabilities;
-    unsigned short wVersion;
-    unsigned short wRPCID;
-    unsigned long  cbMaxToken;
-    SEC_WCHAR     *Name;
-    SEC_WCHAR     *Comment;
+    ULONG      fCapabilities;
+    USHORT     wVersion;
+    USHORT     wRPCID;
+    ULONG      cbMaxToken;
+    SEC_WCHAR *Name;
+    SEC_WCHAR *Comment;
 } SecPkgInfoW, *PSecPkgInfoW;
 
 #define SecPkgInfo WINELIB_NAME_AW(SecPkgInfo)
@@ -133,9 +133,9 @@ typedef struct _SecPkgInfoW
 
 typedef struct _SecBuffer
 {
-    unsigned long cbBuffer;
-    unsigned long BufferType;
-    void         *pvBuffer;
+    ULONG cbBuffer;
+    ULONG BufferType;
+    PVOID pvBuffer;
 } SecBuffer, *PSecBuffer;
 
 /* values for BufferType */
@@ -162,9 +162,9 @@ typedef struct _SecBuffer
 
 typedef struct _SecBufferDesc
 {
-    unsigned long ulVersion;
-    unsigned long cBuffers;
-    PSecBuffer    pBuffers;
+    ULONG      ulVersion;
+    ULONG      cBuffers;
+    PSecBuffer pBuffers;
 } SecBufferDesc, *PSecBufferDesc;
 
 /* values for ulVersion */
@@ -434,19 +434,19 @@ typedef SECURITY_STATUS (SEC_ENTRY *QUERY_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle,
 
 typedef struct _SecPkgContext_Sizes
 {
-    unsigned long cbMaxToken;
-    unsigned long cbMaxSignature;
-    unsigned long cbBlockSize;
-    unsigned long cbSecurityTrailer;
+    ULONG cbMaxToken;
+    ULONG cbMaxSignature;
+    ULONG cbBlockSize;
+    ULONG cbSecurityTrailer;
 } SecPkgContext_Sizes, *PSecPkgContext_Sizes;
 
 typedef struct _SecPkgContext_StreamSizes
 {
-    unsigned long cbHeader;
-    unsigned long cbTrailer;
-    unsigned long cbMaximumMessage;
-    unsigned long cbBuffers;
-    unsigned long cbBlockSize;
+    ULONG cbHeader;
+    ULONG cbTrailer;
+    ULONG cbMaximumMessage;
+    ULONG cbBuffers;
+    ULONG cbBlockSize;
 } SecPkgContext_StreamSizes, *PSecPkgContext_StreamSizes;
 
 typedef struct _SecPkgContext_NamesA
@@ -470,26 +470,26 @@ typedef struct _SecPkgContext_Lifespan
 
 typedef struct _SecPkgContext_DceInfo
 {
-    unsigned long AuthzSvc;
-    void *pPac;
+    ULONG AuthzSvc;
+    PVOID pPac;
 } SecPkgContext_DceInfo, *PSecPkgContext_DceInfo;
 
 typedef struct _SecPkgContext_KeyInfoA
 {
-    SEC_CHAR      *sSignatureAlgorithmName;
-    SEC_CHAR      *sEncryptAlgorithmName;
-    unsigned long  KeySize;
-    unsigned long  SignatureAlgorithm;
-    unsigned long  EncryptAlgorithm;
+    SEC_CHAR *sSignatureAlgorithmName;
+    SEC_CHAR *sEncryptAlgorithmName;
+    ULONG     KeySize;
+    ULONG     SignatureAlgorithm;
+    ULONG     EncryptAlgorithm;
 } SecPkgContext_KeyInfoA, *PSecPkgContext_KeyInfoA;
 
 typedef struct _SecPkgContext_KeyInfoW
 {
-    SEC_WCHAR     *sSignatureAlgorithmName;
-    SEC_WCHAR     *sEncryptAlgorithmName;
-    unsigned long  KeySize;
-    unsigned long  SignatureAlgorithm;
-    unsigned long  EncryptAlgorithm;
+    SEC_WCHAR *sSignatureAlgorithmName;
+    SEC_WCHAR *sEncryptAlgorithmName;
+    ULONG      KeySize;
+    ULONG      SignatureAlgorithm;
+    ULONG      EncryptAlgorithm;
 } SecPkgContext_KeyInfoW, *PSecPkgContext_KeyInfoW;
 
 #define SecPkgContext_KeyInfo WINELIB_NAME_AW(SecPkgContext_KeyInfo)
@@ -510,16 +510,16 @@ typedef struct _SecPkgContext_AuthorityW
 
 typedef struct _SecPkgContext_ProtoInfoA
 {
-    SEC_CHAR     *sProtocolName;
-    unsigned long majorVersion;
-    unsigned long minorVersion;
+    SEC_CHAR *sProtocolName;
+    ULONG     majorVersion;
+    ULONG     minorVersion;
 } SecPkgContext_ProtoInfoA, *PSecPkgContext_ProtoInfoA;
 
 typedef struct _SecPkgContext_ProtoInfoW
 {
-    SEC_WCHAR    *sProtocolName;
-    unsigned long majorVersion;
-    unsigned long minorVersion;
+    SEC_WCHAR *sProtocolName;
+    ULONG      majorVersion;
+    ULONG      minorVersion;
 } SecPkgContext_ProtoInfoW, *PSecPkgContext_ProtoInfoW;
 
 #define SecPkgContext_ProtoInfo WINELIB_NAME_AW(SecPkgContext_ProtoInfo)
@@ -742,7 +742,7 @@ typedef SECURITY_STATUS (SEC_ENTRY *SET_CONTEXT_ATTRIBUTES_FN_W)(PCtxtHandle,
 
 typedef struct _SECURITY_FUNCTION_TABLE_A
 {
-    unsigned long                     dwVersion;
+    ULONG                             dwVersion;
     ENUMERATE_SECURITY_PACKAGES_FN_A  EnumerateSecurityPackagesA;
     QUERY_CREDENTIALS_ATTRIBUTES_FN_A QueryCredentialsAttributesA;
     ACQUIRE_CREDENTIALS_HANDLE_FN_A   AcquireCredentialsHandleA;
@@ -774,7 +774,7 @@ typedef struct _SECURITY_FUNCTION_TABLE_A
 
 typedef struct _SECURITY_FUNCTION_TABLE_W
 {
-    unsigned long                     dwVersion;
+    ULONG                             dwVersion;
     ENUMERATE_SECURITY_PACKAGES_FN_W  EnumerateSecurityPackagesW;
     QUERY_CREDENTIALS_ATTRIBUTES_FN_W QueryCredentialsAttributesW;
     ACQUIRE_CREDENTIALS_HANDLE_FN_W   AcquireCredentialsHandleW;
-- 
1.6.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20090106/fca9837d/attachment.pgp 


More information about the wine-patches mailing list