Declare PNTSTATUS in more headers

Francois Gouget fgouget at free.fr
Wed Aug 10 07:45:45 CDT 2005


The Windows 2003 SP1 PSDK declares PNTSTATUS in the following headers:
   LMaccess.h
   NTSecAPI.h
   SubAuth.h
   wincred.h

However, so far Wine was not declaring it anywhere. So this patch fixes 
that with one difference to the PSDK though. The PSDK does not protect 
the NTSTATUS and PNTSTATUS definitions because MSVC does not complain if 
a type is defined multiple times as long as all the definitions match. 
But gcc will give an error in such a case so Wine's headers protect the 
NTSTATUS and PNTSTATUS definitions with the WINE_NTSTATUS_DECLARED 
macro.

Changelog:

  * dlls/secur32/secur32.c
    include/lmaccess.h
    include/ntsecapi.h
    include/winternl.h

    Francois Gouget <fgouget at free.fr>
    Declare PNTSTATUS in lmaccess.h, ntsecapi.h and wincred.h to match 
the PSDK. Protect against multiple definitions.
    Use PNTSTATUS where appropriate.

-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
    Nouvelle version : les anciens bogues ont été remplacés par de nouveaux.
-------------- next part --------------
Index: dlls/secur32/secur32.c
===================================================================
RCS file: /var/cvs/wine/dlls/secur32/secur32.c,v
retrieving revision 1.7
diff -u -p -r1.7 secur32.c
--- dlls/secur32/secur32.c	18 Jul 2005 09:11:14 -0000	1.7
+++ dlls/secur32/secur32.c	10 Aug 2005 12:23:59 -0000
@@ -958,7 +958,7 @@ BOOLEAN WINAPI GetUserNameExW(
 NTSTATUS WINAPI LsaCallAuthenticationPackage(
   HANDLE LsaHandle, ULONG AuthenticationPackage, PVOID ProtocolSubmitBuffer,
   ULONG SubmitBufferLength, PVOID* ProtocolReturnBuffer, PULONG ReturnBufferLength,
-  NTSTATUS *ProtocolStatus)
+  PNTSTATUS ProtocolStatus)
 {
     FIXME("%p %ld %p %ld %p %p %p\n", LsaHandle, AuthenticationPackage,
           ProtocolSubmitBuffer, SubmitBufferLength, ProtocolReturnBuffer,
Index: include/lmaccess.h
===================================================================
RCS file: /var/cvs/wine/include/lmaccess.h,v
retrieving revision 1.3
diff -u -p -r1.3 lmaccess.h
--- include/lmaccess.h	25 Nov 2003 00:05:39 -0000	1.3
+++ include/lmaccess.h	10 Aug 2005 12:23:59 -0000
@@ -111,6 +111,11 @@ static const WCHAR GROUP_SPECIALGRP_GUES
 static const WCHAR GROUP_SPECIALGRP_LOCAL[] = { 'L','O','C','A','L',0 };
 #endif
 
+#ifndef WINE_NTSTATUS_DECLARED
+#define WINE_NTSTATUS_DECLARED
+typedef LONG NTSTATUS, *PNTSTATUS;
+#endif
+
 /* NetGetUserInfo structures */
 typedef struct _USER_INFO_0 {
     LPWSTR usri0_name;
Index: include/ntsecapi.h
===================================================================
RCS file: /var/cvs/wine/include/ntsecapi.h,v
retrieving revision 1.16
diff -u -p -r1.16 ntsecapi.h
--- include/ntsecapi.h	18 Jul 2005 09:11:14 -0000	1.16
+++ include/ntsecapi.h	10 Aug 2005 12:23:59 -0000
@@ -106,6 +106,16 @@ extern "C" {
 #define SE_DENY_SERVICE_LOGON_NAME \
  TEXT("SeDenyServiceLogonRight")
 
+#ifndef WINE_NTSTATUS_DECLARED
+#define WINE_NTSTATUS_DECLARED
+typedef LONG NTSTATUS, *PNTSTATUS;
+#endif
+
+#ifndef WINE_NTSTATUS_DECLARED
+#define WINE_NTSTATUS_DECLARED_
+typedef LONG NTSTATUS, *PNTSTATUS;
+#endif
+
 typedef enum _SECURITY_LOGON_TYPE
 {
     Interactive = 2,
@@ -196,7 +206,7 @@ typedef struct _LSA_TRANSLATED_SID
     LONG DomainIndex;
 } LSA_TRANSLATED_SID, *PLSA_TRANSLATED_SID;
 
-NTSTATUS WINAPI LsaCallAuthenticationPackage(HANDLE,ULONG,PVOID,ULONG,PVOID*,PULONG,NTSTATUS*);
+NTSTATUS WINAPI LsaCallAuthenticationPackage(HANDLE,ULONG,PVOID,ULONG,PVOID*,PULONG,PNTSTATUS);
 NTSTATUS WINAPI LsaClose(LSA_HANDLE);
 NTSTATUS WINAPI LsaConnectUntrusted(PHANDLE);
 NTSTATUS WINAPI LsaDeregisterLogonProcess(HANDLE);
Index: include/winternl.h
===================================================================
RCS file: /var/cvs/wine/include/winternl.h,v
retrieving revision 1.160
diff -u -p -r1.160 winternl.h
--- include/winternl.h	2 Aug 2005 11:38:51 -0000	1.160
+++ include/winternl.h	10 Aug 2005 12:23:59 -0000
@@ -32,7 +32,10 @@ extern "C" {
  * Fundamental types and data structures
  */
 
-typedef LONG NTSTATUS;
+#ifndef WINE_NTSTATUS_DECLARED
+#define WINE_NTSTATUS_DECLARED
+typedef LONG NTSTATUS, *PNTSTATUS;
+#endif
 
 typedef CONST char *PCSZ;
 


More information about the wine-patches mailing list