ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2012
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
559 discussions
Start a n
N
ew thread
[tkreuzer] 54827: [USBDRV] remove hacks to fix build
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Jan 3 20:23:29 2012 New Revision: 54827 URL:
http://svn.reactos.org/svn/reactos?rev=54827&view=rev
Log: [USBDRV] remove hacks to fix build Modified: trunk/reactos/drivers/usb/nt4compat/usbdrv/usbdriver.h Modified: trunk/reactos/drivers/usb/nt4compat/usbdrv/usbdriver.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
============================================================================== --- trunk/reactos/drivers/usb/nt4compat/usbdrv/usbdriver.h [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/nt4compat/usbdrv/usbdriver.h [iso-8859-1] Tue Jan 3 20:23:29 2012 @@ -1,19 +1,5 @@ //#define NTDDI_VERSION NTDDI_WIN2K //#define _WIN32_WINNT _WIN32_WINNT_WIN2K - -// hacks for WDK -#define __field_bcount_part_opt(x,y) -#define __field_bcount_part(x,y) -#define __field_bcount_opt(x) -#define __in_range(a,b) -#define __volatile -#define __struct_bcount(x) -#define __inexpressible_readableTo(x) -#define __deref_volatile -#ifndef __field_ecount -# define __field_ecount(x) -#endif - #include <ntddk.h> #include <stdio.h>
12 years, 11 months
1
0
0
0
[tkreuzer] 54826: Fix build
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Jan 3 20:15:25 2012 New Revision: 54826 URL:
http://svn.reactos.org/svn/reactos?rev=54826&view=rev
Log: Fix build Modified: trunk/reactos/include/crt/crtdefs.h Modified: trunk/reactos/include/crt/crtdefs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/crtdefs.h?rev=…
============================================================================== --- trunk/reactos/include/crt/crtdefs.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/crtdefs.h [iso-8859-1] Tue Jan 3 20:15:25 2012 @@ -4,7 +4,9 @@ * No warranty is given; refer to the file DISCLAIMER within this package. */ #include <_mingw.h> +#ifndef __cplusplus #include <specstrings.h> +#endif #ifndef _INC_CRTDEFS #define _INC_CRTDEFS
12 years, 11 months
1
0
0
0
[tkreuzer] 54825: [XDK/DDK] - Add sspi.h to xdk and and include it in ntifs.h. Dedicated to Alex
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Jan 3 19:42:58 2012 New Revision: 54825 URL:
http://svn.reactos.org/svn/reactos?rev=54825&view=rev
Log: [XDK/DDK] - Add sspi.h to xdk and and include it in ntifs.h. Dedicated to Alex Added: trunk/reactos/include/xdk/sspi.h (with props) Modified: trunk/reactos/include/ddk/ntifs.h trunk/reactos/include/xdk/ntifs.template.h trunk/reactos/include/xdk/rtlfuncs.h Modified: trunk/reactos/include/ddk/ntifs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntifs.h?rev=54…
============================================================================== --- trunk/reactos/include/ddk/ntifs.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ntifs.h [iso-8859-1] Tue Jan 3 19:42:58 2012 @@ -8785,20 +8785,1325 @@ IN ULONG TokenInformationLength); #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ +#ifndef __SSPI_H__ +#define __SSPI_H__ + +// for ntifs.h: +#define ISSP_LEVEL 32 +#define ISSP_MODE 0 + +#ifdef MIDL_PASS +#define MIDL_PROP(x) x +#else +#define MIDL_PROP(x) +#endif + +#define SEC_TEXT TEXT +#define SEC_FAR +#define SEC_ENTRY __stdcall + +#if defined(_NO_KSECDD_IMPORT_) +#define KSECDDDECLSPEC +#else +#define KSECDDDECLSPEC __declspec(dllimport) +#endif + +#define SECQOP_WRAP_NO_ENCRYPT 0x80000001 +#define SECQOP_WRAP_OOB_DATA 0x40000000 + +#define SECURITY_ENTRYPOINTW SEC_TEXT("InitSecurityInterfaceW") +#define SECURITY_ENTRYPOINT SECURITY_ENTRYPOINTW + +#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION 1 +#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2 2 +#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_3 3 +#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_4 4 + +#define SECURITY_NATIVE_DREP 0x00000010 +#define SECURITY_NETWORK_DREP 0x00000000 + +#define SECPKG_ID_NONE 0xFFFF + +#define SECPKG_CRED_ATTR_NAMES 1 +#define SECPKG_CRED_ATTR_SSI_PROVIDER 2 + +#define SECPKG_ATTR_SIZES 0 +#define SECPKG_ATTR_NAMES 1 +#define SECPKG_ATTR_LIFESPAN 2 +#define SECPKG_ATTR_DCE_INFO 3 +#define SECPKG_ATTR_STREAM_SIZES 4 +#define SECPKG_ATTR_KEY_INFO 5 +#define SECPKG_ATTR_AUTHORITY 6 +#define SECPKG_ATTR_PROTO_INFO 7 +#define SECPKG_ATTR_PASSWORD_EXPIRY 8 +#define SECPKG_ATTR_SESSION_KEY 9 +#define SECPKG_ATTR_PACKAGE_INFO 10 +#define SECPKG_ATTR_USER_FLAGS 11 +#define SECPKG_ATTR_NEGOTIATION_INFO 12 +#define SECPKG_ATTR_NATIVE_NAMES 13 +#define SECPKG_ATTR_FLAGS 14 +#define SECPKG_ATTR_USE_VALIDATED 15 +#define SECPKG_ATTR_CREDENTIAL_NAME 16 +#define SECPKG_ATTR_TARGET_INFORMATION 17 +#define SECPKG_ATTR_ACCESS_TOKEN 18 +#define SECPKG_ATTR_TARGET 19 +#define SECPKG_ATTR_AUTHENTICATION_ID 20 +#define SECPKG_ATTR_LOGOFF_TIME 21 +#define SECPKG_ATTR_NEGO_KEYS 22 +#define SECPKG_ATTR_PROMPTING_NEEDED 24 +#define SECPKG_ATTR_UNIQUE_BINDINGS 25 +#define SECPKG_ATTR_ENDPOINT_BINDINGS 26 +#define SECPKG_ATTR_CLIENT_SPECIFIED_TARGET 27 +#define SECPKG_ATTR_LAST_CLIENT_TOKEN_STATUS 30 +#define SECPKG_ATTR_NEGO_PKG_INFO 31 +#define SECPKG_ATTR_NEGO_STATUS 32 +#define SECPKG_ATTR_CONTEXT_DELETED 33 + +#define SECPKG_FLAG_INTEGRITY 0x00000001 +#define SECPKG_FLAG_PRIVACY 0x00000002 +#define SECPKG_FLAG_TOKEN_ONLY 0x00000004 +#define SECPKG_FLAG_DATAGRAM 0x00000008 +#define SECPKG_FLAG_CONNECTION 0x00000010 +#define SECPKG_FLAG_MULTI_REQUIRED 0x00000020 +#define SECPKG_FLAG_CLIENT_ONLY 0x00000040 +#define SECPKG_FLAG_EXTENDED_ERROR 0x00000080 +#define SECPKG_FLAG_IMPERSONATION 0x00000100 +#define SECPKG_FLAG_ACCEPT_WIN32_NAME 0x00000200 +#define SECPKG_FLAG_STREAM 0x00000400 +#define SECPKG_FLAG_NEGOTIABLE 0x00000800 +#define SECPKG_FLAG_GSS_COMPATIBLE 0x00001000 +#define SECPKG_FLAG_LOGON 0x00002000 +#define SECPKG_FLAG_ASCII_BUFFERS 0x00004000 +#define SECPKG_FLAG_FRAGMENT 0x00008000 +#define SECPKG_FLAG_MUTUAL_AUTH 0x00010000 +#define SECPKG_FLAG_DELEGATION 0x00020000 +#define SECPKG_FLAG_READONLY_WITH_CHECKSUM 0x00040000 +#define SECPKG_FLAG_RESTRICTED_TOKENS 0x00080000 +#define SECPKG_FLAG_NEGO_EXTENDER 0x00100000 +#define SECPKG_FLAG_NEGOTIABLE2 0x00200000 + +#define SECPKG_CRED_INBOUND 0x00000001 +#define SECPKG_CRED_OUTBOUND 0x00000002 +#define SECPKG_CRED_BOTH 0x00000003 +#define SECPKG_CRED_DEFAULT 0x00000004 +#define SECPKG_CRED_RESERVED 0xF0000000 +#define SECPKG_CRED_AUTOLOGON_RESTRICTED 0x00000010 +#define SECPKG_CRED_PROCESS_POLICY_ONLY 0x00000020 + +#define SECPKG_CONTEXT_EXPORT_RESET_NEW 0x00000001 +#define SECPKG_CONTEXT_EXPORT_DELETE_OLD 0x00000002 +#define SECPKG_CONTEXT_EXPORT_TO_KERNEL 0x00000004 + +#define SECPKG_ATTR_SUBJECT_SECURITY_ATTRIBUTES 128 +#define SECPKG_ATTR_NEGO_INFO_FLAG_NO_KERBEROS 0x1 +#define SECPKG_ATTR_NEGO_INFO_FLAG_NO_NTLM 0x2 + +#define SecPkgContext_NativeNames SecPkgContext_NativeNamesW +#define PSecPkgContext_NativeNames PSecPkgContext_NativeNamesW + +#define SECBUFFER_VERSION 0 + +#define SECBUFFER_EMPTY 0 +#define SECBUFFER_DATA 1 +#define SECBUFFER_TOKEN 2 +#define SECBUFFER_PKG_PARAMS 3 +#define SECBUFFER_MISSING 4 +#define SECBUFFER_EXTRA 5 +#define SECBUFFER_STREAM_TRAILER 6 +#define SECBUFFER_STREAM_HEADER 7 +#define SECBUFFER_NEGOTIATION_INFO 8 +#define SECBUFFER_PADDING 9 +#define SECBUFFER_STREAM 10 +#define SECBUFFER_MECHLIST 11 +#define SECBUFFER_MECHLIST_SIGNATURE 12 +#define SECBUFFER_TARGET 13 +#define SECBUFFER_CHANNEL_BINDINGS 14 +#define SECBUFFER_CHANGE_PASS_RESPONSE 15 +#define SECBUFFER_TARGET_HOST 16 +#define SECBUFFER_ALERT 17 + +#define SECBUFFER_ATTRMASK 0xF0000000 +#define SECBUFFER_READONLY 0x80000000 +#define SECBUFFER_READONLY_WITH_CHECKSUM 0x10000000 +#define SECBUFFER_RESERVED 0x60000000 + +#define ISC_REQ_DELEGATE 0x00000001 +#define ISC_REQ_MUTUAL_AUTH 0x00000002 +#define ISC_REQ_REPLAY_DETECT 0x00000004 +#define ISC_REQ_SEQUENCE_DETECT 0x00000008 +#define ISC_REQ_CONFIDENTIALITY 0x00000010 +#define ISC_REQ_USE_SESSION_KEY 0x00000020 +#define ISC_REQ_PROMPT_FOR_CREDS 0x00000040 +#define ISC_REQ_USE_SUPPLIED_CREDS 0x00000080 +#define ISC_REQ_ALLOCATE_MEMORY 0x00000100 +#define ISC_REQ_USE_DCE_STYLE 0x00000200 +#define ISC_REQ_DATAGRAM 0x00000400 +#define ISC_REQ_CONNECTION 0x00000800 +#define ISC_REQ_CALL_LEVEL 0x00001000 +#define ISC_REQ_FRAGMENT_SUPPLIED 0x00002000 +#define ISC_REQ_EXTENDED_ERROR 0x00004000 +#define ISC_REQ_STREAM 0x00008000 +#define ISC_REQ_INTEGRITY 0x00010000 +#define ISC_REQ_IDENTIFY 0x00020000 +#define ISC_REQ_NULL_SESSION 0x00040000 +#define ISC_REQ_MANUAL_CRED_VALIDATION 0x00080000 +#define ISC_REQ_RESERVED1 0x00100000 +#define ISC_REQ_FRAGMENT_TO_FIT 0x00200000 +#define ISC_REQ_FORWARD_CREDENTIALS 0x00400000 +#define ISC_REQ_NO_INTEGRITY 0x00800000 +#define ISC_REQ_USE_HTTP_STYLE 0x01000000 + +#define ISC_RET_DELEGATE 0x00000001 +#define ISC_RET_MUTUAL_AUTH 0x00000002 +#define ISC_RET_REPLAY_DETECT 0x00000004 +#define ISC_RET_SEQUENCE_DETECT 0x00000008 +#define ISC_RET_CONFIDENTIALITY 0x00000010 +#define ISC_RET_USE_SESSION_KEY 0x00000020 +#define ISC_RET_USED_COLLECTED_CREDS 0x00000040 +#define ISC_RET_USED_SUPPLIED_CREDS 0x00000080 +#define ISC_RET_ALLOCATED_MEMORY 0x00000100 +#define ISC_RET_USED_DCE_STYLE 0x00000200 +#define ISC_RET_DATAGRAM 0x00000400 +#define ISC_RET_CONNECTION 0x00000800 +#define ISC_RET_INTERMEDIATE_RETURN 0x00001000 +#define ISC_RET_CALL_LEVEL 0x00002000 +#define ISC_RET_EXTENDED_ERROR 0x00004000 +#define ISC_RET_STREAM 0x00008000 +#define ISC_RET_INTEGRITY 0x00010000 +#define ISC_RET_IDENTIFY 0x00020000 +#define ISC_RET_NULL_SESSION 0x00040000 +#define ISC_RET_MANUAL_CRED_VALIDATION 0x00080000 +#define ISC_RET_RESERVED1 0x00100000 +#define ISC_RET_FRAGMENT_ONLY 0x00200000 +#define ISC_RET_FORWARD_CREDENTIALS 0x00400000 +#define ISC_RET_USED_HTTP_STYLE 0x01000000 +#define ISC_RET_NO_ADDITIONAL_TOKEN 0x02000000 +#define ISC_RET_REAUTHENTICATION 0x08000000 + +#define ASC_REQ_DELEGATE 0x00000001 +#define ASC_REQ_MUTUAL_AUTH 0x00000002 +#define ASC_REQ_REPLAY_DETECT 0x00000004 +#define ASC_REQ_SEQUENCE_DETECT 0x00000008 +#define ASC_REQ_CONFIDENTIALITY 0x00000010 +#define ASC_REQ_USE_SESSION_KEY 0x00000020 +#define ASC_REQ_ALLOCATE_MEMORY 0x00000100 +#define ASC_REQ_USE_DCE_STYLE 0x00000200 +#define ASC_REQ_DATAGRAM 0x00000400 +#define ASC_REQ_CONNECTION 0x00000800 +#define ASC_REQ_CALL_LEVEL 0x00001000 +#define ASC_REQ_EXTENDED_ERROR 0x00008000 +#define ASC_REQ_STREAM 0x00010000 +#define ASC_REQ_INTEGRITY 0x00020000 +#define ASC_REQ_LICENSING 0x00040000 +#define ASC_REQ_IDENTIFY 0x00080000 +#define ASC_REQ_ALLOW_NULL_SESSION 0x00100000 +#define ASC_REQ_ALLOW_NON_USER_LOGONS 0x00200000 +#define ASC_REQ_ALLOW_CONTEXT_REPLAY 0x00400000 +#define ASC_REQ_FRAGMENT_TO_FIT 0x00800000 +#define ASC_REQ_FRAGMENT_SUPPLIED 0x00002000 +#define ASC_REQ_NO_TOKEN 0x01000000 +#define ASC_REQ_PROXY_BINDINGS 0x04000000 +//#define SSP_RET_REAUTHENTICATION 0x08000000 // internal + +#define ASC_REQ_ALLOW_MISSING_BINDINGS 0x10000000 +#define ASC_RET_DELEGATE 0x00000001 +#define ASC_RET_MUTUAL_AUTH 0x00000002 +#define ASC_RET_REPLAY_DETECT 0x00000004 +#define ASC_RET_SEQUENCE_DETECT 0x00000008 +#define ASC_RET_CONFIDENTIALITY 0x00000010 +#define ASC_RET_USE_SESSION_KEY 0x00000020 +#define ASC_RET_ALLOCATED_MEMORY 0x00000100 +#define ASC_RET_USED_DCE_STYLE 0x00000200 +#define ASC_RET_DATAGRAM 0x00000400 +#define ASC_RET_CONNECTION 0x00000800 +#define ASC_RET_CALL_LEVEL 0x00002000 +#define ASC_RET_THIRD_LEG_FAILED 0x00004000 +#define ASC_RET_EXTENDED_ERROR 0x00008000 +#define ASC_RET_STREAM 0x00010000 +#define ASC_RET_INTEGRITY 0x00020000 +#define ASC_RET_LICENSING 0x00040000 +#define ASC_RET_IDENTIFY 0x00080000 +#define ASC_RET_NULL_SESSION 0x00100000 +#define ASC_RET_ALLOW_NON_USER_LOGONS 0x00200000 +#define ASC_RET_ALLOW_CONTEXT_REPLAY 0x00400000 +#define ASC_RET_FRAGMENT_ONLY 0x00800000 +#define ASC_RET_NO_TOKEN 0x01000000 +#define ASC_RET_NO_ADDITIONAL_TOKEN 0x02000000 +#define ASC_RET_NO_PROXY_BINDINGS 0x04000000 +//#define SSP_RET_REAUTHENTICATION 0x08000000 // internal +#define ASC_RET_MISSING_BINDINGS 0x10000000 + +#define SEC_DELETED_HANDLE ((ULONG_PTR)(-2)) + +#define SecInvalidateHandle(x) \ + ((PSecHandle)(x))->dwLower = ((PSecHandle)(x))->dwUpper = ((ULONG_PTR)((INT_PTR)-1)); + +#define SecIsValidHandle(x) \ + ( ( ((PSecHandle)(x))->dwLower != (ULONG_PTR)(INT_PTR)-1 ) && \ + ( ((PSecHandle)(x))->dwUpper != (ULONG_PTR)(INT_PTR)-1 ) ) + +typedef WCHAR SEC_WCHAR; +typedef CHAR SEC_CHAR; +typedef LARGE_INTEGER _SECURITY_INTEGER, SECURITY_INTEGER, *PSECURITY_INTEGER; +typedef SECURITY_INTEGER TimeStamp, *PTimeStamp; +typedef UNICODE_STRING SECURITY_STRING, *PSECURITY_STRING; +#if ISSP_MODE == 0 +#define PSSPI_SEC_STRING PSECURITY_STRING +#else +#define PSSPI_SEC_STRING SEC_WCHAR* +#endif + +typedef PVOID PSEC_WINNT_AUTH_IDENTITY_OPAQUE; + +#ifndef __SECSTATUS_DEFINED__ +typedef LONG SECURITY_STATUS; +#define __SECSTATUS_DEFINED__ +#endif + +typedef enum _SECPKG_CRED_CLASS +{ + SecPkgCredClass_None = 0, + SecPkgCredClass_Ephemeral = 10, + SecPkgCredClass_PersistedGeneric = 20, + SecPkgCredClass_PersistedSpecific = 30, + SecPkgCredClass_Explicit = 40, +} SECPKG_CRED_CLASS, *PSECPKG_CRED_CLASS; + +typedef struct _SEC_NEGOTIATION_INFO +{ + ULONG Size; + ULONG NameLength; + SEC_WCHAR * Name; + PVOID Reserved; +} SEC_NEGOTIATION_INFO, *PSEC_NEGOTIATION_INFO; + +typedef struct _SEC_CHANNEL_BINDINGS +{ + ULONG dwInitiatorAddrType; + ULONG cbInitiatorLength; + ULONG dwInitiatorOffset; + ULONG dwAcceptorAddrType; + ULONG cbAcceptorLength; + ULONG dwAcceptorOffset; + ULONG cbApplicationDataLength; + ULONG dwApplicationDataOffset; +} SEC_CHANNEL_BINDINGS, *PSEC_CHANNEL_BINDINGS; + +#ifndef _AUTH_IDENTITY_EX2_DEFINED +#define _AUTH_IDENTITY_EX2_DEFINED +typedef struct _SEC_WINNT_AUTH_IDENTITY_EX2 { + ULONG Version; + USHORT cbHeaderLength; + ULONG cbStructureLength; + ULONG UserOffset; + USHORT UserLength; + ULONG DomainOffset; + USHORT DomainLength; + ULONG PackedCredentialsOffset; + USHORT PackedCredentialsLength; + ULONG Flags; + ULONG PackageListOffset; + USHORT PackageListLength; +} SEC_WINNT_AUTH_IDENTITY_EX2, *PSEC_WINNT_AUTH_IDENTITY_EX2; +#define SEC_WINNT_AUTH_IDENTITY_VERSION_2 0x201 +#endif + +#ifndef _AUTH_IDENTITY_DEFINED +#define _AUTH_IDENTITY_DEFINED +typedef struct _SEC_WINNT_AUTH_IDENTITY_W { + PUSHORT User; + ULONG UserLength; + PUSHORT Domain; + ULONG DomainLength; + PUSHORT Password; + ULONG PasswordLength; + ULONG Flags; +} SEC_WINNT_AUTH_IDENTITY_W, *PSEC_WINNT_AUTH_IDENTITY_W; +#define SEC_WINNT_AUTH_IDENTITY_ANSI 0x1 +#define SEC_WINNT_AUTH_IDENTITY_UNICODE 0x2 +#define SEC_WINNT_AUTH_IDENTITY SEC_WINNT_AUTH_IDENTITY_W +#define PSEC_WINNT_AUTH_IDENTITY PSEC_WINNT_AUTH_IDENTITY_W +#define _SEC_WINNT_AUTH_IDENTITY _SEC_WINNT_AUTH_IDENTITY_W +#endif + +#ifndef SEC_WINNT_AUTH_IDENTITY_VERSION +#define SEC_WINNT_AUTH_IDENTITY_VERSION 0x200 +typedef struct _SEC_WINNT_AUTH_IDENTITY_EXW { + ULONG Version; + ULONG Length; + PUSHORT User; // Non-NULL terminated string. + ULONG UserLength; // # of characters (NOT bytes), not including NULL. + PUSHORT Domain; // Non-NULL terminated string. + ULONG DomainLength; // # of characters (NOT bytes), not including NULL. + PUSHORT Password; // Non-NULL terminated string. + ULONG PasswordLength; // # of characters (NOT bytes), not including NULL. + ULONG Flags; + PUSHORT PackageList; + ULONG PackageListLength; +} SEC_WINNT_AUTH_IDENTITY_EXW, *PSEC_WINNT_AUTH_IDENTITY_EXW; +#define SEC_WINNT_AUTH_IDENTITY_EX SEC_WINNT_AUTH_IDENTITY_EXW +#define PSEC_WINNT_AUTH_IDENTITY_EX PSEC_WINNT_AUTH_IDENTITY_EXW +#endif + +#ifndef __SECHANDLE_DEFINED__ +typedef struct _SecHandle +{ + ULONG_PTR dwLower; + ULONG_PTR dwUpper; +} SecHandle, *PSecHandle; +#define __SECHANDLE_DEFINED__ +#endif + +typedef SecHandle CredHandle, *PCredHandle, CtxtHandle, *PCtxtHandle; + +typedef struct _SecBuffer +{ + ULONG cbBuffer; + ULONG BufferType; +#ifdef MIDL_PASS + MIDL_PROP([size_is(cbBuffer)]) PCHAR pvBuffer; +#else + __field_bcount(cbBuffer) void SEC_FAR *pvBuffer; +#endif +} SecBuffer, * PSecBuffer; + +typedef struct _SecBufferDesc +{ + ULONG ulVersion; + ULONG cBuffers; + MIDL_PROP([size_is(cBuffers)]) __field_ecount(cBuffers) PSecBuffer pBuffers; +} SecBufferDesc, SEC_FAR * PSecBufferDesc; + +typedef struct _SecPkgInfoW +{ + ULONG fCapabilities; + USHORT wVersion; + USHORT wRPCID; + ULONG cbMaxToken; + MIDL_PROP([string]) SEC_WCHAR *Name; + MIDL_PROP([string]) SEC_WCHAR *Comment; +} SecPkgInfoW, *PSecPkgInfoW; +#define SecPkgInfo SecPkgInfoW +#define PSecPkgInfo PSecPkgInfoW + +typedef struct _SecPkgCredentials_NamesW +{ + MIDL_PROP([string]) SEC_WCHAR * sUserName; +} SecPkgCredentials_NamesW, * PSecPkgCredentials_NamesW; +#define SecPkgCredentials_Names SecPkgCredentials_NamesW +#define PSecPkgCredentials_Names PSecPkgCredentials_NamesW + +typedef struct _SecPkgContext_NamesW +{ + SEC_WCHAR *sUserName; +} SecPkgContext_NamesW, *PSecPkgContext_NamesW; +#define SecPkgContext_Names SecPkgContext_NamesW +#define PSecPkgContext_Names PSecPkgContext_NamesW + +#if OSVER(NTDDI_VERSION) > NTDDI_WIN2K +typedef struct _SecPkgContext_CredentialNameW +{ + ULONG CredentialType; + SEC_WCHAR *sCredentialName; +} SecPkgContext_CredentialNameW, *PSecPkgContext_CredentialNameW; +#endif +#define SecPkgContext_CredentialName SecPkgContext_CredentialNameW +#define PSecPkgContext_CredentialName PSecPkgContext_CredentialNameW + +typedef struct _SecPkgContext_SubjectAttributes { + PVOID AttributeInfo; +} SecPkgContext_SubjectAttributes, *PSecPkgContext_SubjectAttributes; + +typedef struct _SecPkgContext_CredInfo { + SECPKG_CRED_CLASS CredClass; + ULONG IsPromptingNeeded; +} SecPkgContext_CredInfo, *PSecPkgContext_CredInfo; + +typedef struct _SecPkgContext_NegoPackageInfo +{ + ULONG PackageMask; +} SecPkgContext_NegoPackageInfo, * PSecPkgContext_NegoPackageInfo; + +typedef struct _SecPkgContext_NegoStatus +{ + ULONG LastStatus; +} SecPkgContext_NegoStatus, *PSecPkgContext_NegoStatus; + +typedef struct _SecPkgContext_Sizes +{ + ULONG cbMaxToken; + ULONG cbMaxSignature; + ULONG cbBlockSize; + ULONG cbSecurityTrailer; +} SecPkgContext_Sizes, *PSecPkgContext_Sizes; + +typedef struct _SecPkgContext_StreamSizes +{ + ULONG cbHeader; + ULONG cbTrailer; + ULONG cbMaximumMessage; + ULONG cBuffers; + ULONG cbBlockSize; +} SecPkgContext_StreamSizes, *PSecPkgContext_StreamSizes; + +typedef struct _SecPkgContext_Lifespan +{ + TimeStamp tsStart; + TimeStamp tsExpiry; +} SecPkgContext_Lifespan, *PSecPkgContext_Lifespan; + +typedef struct _SecPkgContext_PasswordExpiry +{ + TimeStamp tsPasswordExpires; +} SecPkgContext_PasswordExpiry, * PSecPkgContext_PasswordExpiry; + +typedef struct _SecPkgContext_ProtoInfoW +{ + SEC_WCHAR *sProtocolName; + ULONG majorVersion; + ULONG minorVersion; +} SecPkgContext_ProtoInfoW, *PSecPkgContext_ProtoInfoW; +#define SecPkgContext_ProtoInfo SecPkgContext_ProtoInfoW +#define PSecPkgContext_ProtoInfo PSecPkgContext_ProtoInfoW + +typedef struct _SecPkgContext_KeyInfoW +{ + SEC_WCHAR *sSignatureAlgorithmName; + SEC_WCHAR *sEncryptAlgorithmName; + ULONG KeySize; + ULONG SignatureAlgorithm; + ULONG EncryptAlgorithm; +} SecPkgContext_KeyInfoW, *PSecPkgContext_KeyInfoW; +#define SecPkgContext_KeyInfo SecPkgContext_KeyInfoW +#define PSecPkgContext_KeyInfo PSecPkgContext_KeyInfoW + +typedef struct _SecPkgContext_SessionKey +{ + ULONG SessionKeyLength; + __field_bcount(SessionKeyLength) PUCHAR SessionKey; +} SecPkgContext_SessionKey, *PSecPkgContext_SessionKey; + +typedef struct _SecPkgContext_NegoKeys +{ + ULONG KeyType; + USHORT KeyLength; + __field_bcount(KeyLength) PUCHAR KeyValue; + ULONG VerifyKeyType; + USHORT VerifyKeyLength; + __field_bcount(VerifyKeyLength) PUCHAR VerifyKeyValue; +} SecPkgContext_NegoKeys, *PSecPkgContext_NegoKeys; + +typedef struct _SecPkgContext_DceInfo +{ + ULONG AuthzSvc; + PVOID pPac; +} SecPkgContext_DceInfo, *PSecPkgContext_DceInfo; + +typedef struct _SecPkgContext_PackageInfoW +{ + PSecPkgInfoW PackageInfo; +} SecPkgContext_PackageInfoW, *PSecPkgContext_PackageInfoW; +#define SecPkgContext_PackageInfo SecPkgContext_PackageInfoW +#define PSecPkgContext_PackageInfo PSecPkgContext_PackageInfoW + +typedef struct _SecPkgContext_UserFlags +{ + ULONG UserFlags; +} SecPkgContext_UserFlags, *PSecPkgContext_UserFlags; + +typedef struct _SecPkgContext_Flags +{ + ULONG Flags; +} SecPkgContext_Flags, *PSecPkgContext_Flags; + +typedef struct _SecPkgContext_NegotiationInfoW +{ + PSecPkgInfoW PackageInfo ; + ULONG NegotiationState ; +} SecPkgContext_NegotiationInfoW, *PSecPkgContext_NegotiationInfoW ; + +typedef struct _SecPkgContext_AuthorityW +{ + SEC_WCHAR *sAuthorityName; +} SecPkgContext_AuthorityW, *PSecPkgContext_AuthorityW; +#define SecPkgContext_Authority SecPkgContext_AuthorityW +#define PSecPkgContext_Authority PSecPkgContext_AuthorityW + + +#if NTDDI_VERSION > NTDDI_WS03 +typedef struct _SecPkgCredentials_SSIProviderW +{ + SEC_WCHAR *sProviderName; + ULONG ProviderInfoLength; + PCHAR ProviderInfo; +} SecPkgCredentials_SSIProviderW, * PSecPkgCredentials_SSIProviderW; +#define SecPkgCredentials_SSIProvider SecPkgCredentials_SSIProviderW +#define PSecPkgCredentials_SSIProvider PSecPkgCredentials_SSIProviderW + +typedef struct _SecPkgContext_LogoffTime +{ + TimeStamp tsLogoffTime; +} SecPkgContext_LogoffTime, *PSecPkgContext_LogoffTime; +#endif + +/* forward declaration */ +typedef struct _SECURITY_FUNCTION_TABLE_W SecurityFunctionTableW, * PSecurityFunctionTableW; +#define SecurityFunctionTable SecurityFunctionTableW +#define PSecurityFunctionTable PSecurityFunctionTableW + +typedef +VOID +(SEC_ENTRY * SEC_GET_KEY_FN)( + PVOID Arg, + PVOID Principal, + ULONG KeyVer, + PVOID *Key, + SECURITY_STATUS *Status); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +AcceptSecurityContext( + __in_opt PCredHandle phCredential, + __in_opt PCtxtHandle phContext, + __in_opt PSecBufferDesc pInput, + __in ULONG fContextReq, + __in ULONG TargetDataRep, + __in_opt PCtxtHandle phNewContext, + __in_opt PSecBufferDesc pOutput, + __out PULONG pfContextAttr, + __out_opt PTimeStamp ptsExpiry); + +typedef +SECURITY_STATUS +(SEC_ENTRY * ACCEPT_SECURITY_CONTEXT_FN)( + PCredHandle, + PCtxtHandle, + PSecBufferDesc, + ULONG, + ULONG, + PCtxtHandle, + PSecBufferDesc, + PULONG, + PTimeStamp); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +AcquireCredentialsHandleW( + __in_opt PSSPI_SEC_STRING pPrincipal, + __in PSSPI_SEC_STRING pPackage, + __in ULONG fCredentialUse, + __in_opt PVOID pvLogonId, + __in_opt PVOID pAuthData, + __in_opt SEC_GET_KEY_FN pGetKeyFn, + __in_opt PVOID pvGetKeyArgument, + __out PCredHandle phCredential, + __out_opt PTimeStamp ptsExpiry); +#define AcquireCredentialsHandle AcquireCredentialsHandleW + +typedef +SECURITY_STATUS +(SEC_ENTRY * ACQUIRE_CREDENTIALS_HANDLE_FN_W)( + PSSPI_SEC_STRING, + PSSPI_SEC_STRING, + ULONG, + PVOID, + PVOID, + SEC_GET_KEY_FN, + PVOID, + PCredHandle, + PTimeStamp); +#define ACQUIRE_CREDENTIALS_HANDLE_FN ACQUIRE_CREDENTIALS_HANDLE_FN_W + +SECURITY_STATUS +SEC_ENTRY +AddCredentialsA( + __in PCredHandle hCredentials, + __in_opt LPSTR pszPrincipal, + __in LPSTR pszPackage, + __in ULONG fCredentialUse, + __in_opt PVOID pAuthData, + __in_opt SEC_GET_KEY_FN pGetKeyFn, + __in_opt PVOID pvGetKeyArgument, + __out_opt PTimeStamp ptsExpiry); + +typedef +SECURITY_STATUS +(SEC_ENTRY * ADD_CREDENTIALS_FN_A)( + PCredHandle, + SEC_CHAR *, + SEC_CHAR *, + ULONG, + PVOID, + SEC_GET_KEY_FN, + PVOID, + PTimeStamp); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +AddCredentialsW( + __in PCredHandle hCredentials, + __in_opt PSSPI_SEC_STRING pPrincipal, + __in PSSPI_SEC_STRING pPackage, + __in ULONG fCredentialUse, + __in_opt PVOID pAuthData, + __in_opt SEC_GET_KEY_FN pGetKeyFn, + __in_opt PVOID pvGetKeyArgument, + __out_opt PTimeStamp ptsExpiry); + +typedef +SECURITY_STATUS +(SEC_ENTRY * ADD_CREDENTIALS_FN_W)( + PCredHandle, + PSSPI_SEC_STRING, + PSSPI_SEC_STRING, + ULONG, + PVOID, + SEC_GET_KEY_FN, + PVOID, + PTimeStamp); + +#ifdef UNICODE +#define AddCredentials AddCredentialsW +#define ADD_CREDENTIALS_FN ADD_CREDENTIALS_FN_W +#else +#define AddCredentials AddCredentialsA +#define ADD_CREDENTIALS_FN ADD_CREDENTIALS_FN_A +#endif + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +ApplyControlToken( + __in PCtxtHandle phContext, + __in PSecBufferDesc pInput); + +typedef +SECURITY_STATUS +(SEC_ENTRY * APPLY_CONTROL_TOKEN_FN)( + PCtxtHandle, PSecBufferDesc); + +#if (ISSP_MODE != 0) + +SECURITY_STATUS +SEC_ENTRY +ChangeAccountPasswordA( + __in SEC_CHAR* pszPackageName, + __in SEC_CHAR* pszDomainName, + __in SEC_CHAR* pszAccountName, + __in SEC_CHAR* pszOldPassword, + __in SEC_CHAR* pszNewPassword, + __in BOOLEAN bImpersonating, + __in ULONG dwReserved, + __inout PSecBufferDesc pOutput); + +typedef +SECURITY_STATUS +(SEC_ENTRY * CHANGE_PASSWORD_FN_A)( + SEC_CHAR *, + SEC_CHAR *, + SEC_CHAR *, + SEC_CHAR *, + SEC_CHAR *, + BOOLEAN, + ULONG, + PSecBufferDesc); + +SECURITY_STATUS +SEC_ENTRY +ChangeAccountPasswordW( + __in SEC_WCHAR* pszPackageName, + __in SEC_WCHAR* pszDomainName, + __in SEC_WCHAR* pszAccountName, + __in SEC_WCHAR* pszOldPassword, + __in SEC_WCHAR* pszNewPassword, + __in BOOLEAN bImpersonating, + __in ULONG dwReserved, + __inout PSecBufferDesc pOutput); + +typedef +SECURITY_STATUS +(SEC_ENTRY * CHANGE_PASSWORD_FN_W)( + SEC_WCHAR *, + SEC_WCHAR *, + SEC_WCHAR *, + SEC_WCHAR *, + SEC_WCHAR *, + BOOLEAN, + ULONG, + PSecBufferDesc); + +#ifdef UNICODE +#define ChangeAccountPassword ChangeAccountPasswordW +#define CHANGE_PASSWORD_FN CHANGE_PASSWORD_FN_W +#else +#define ChangeAccountPassword ChangeAccountPasswordA +#define CHANGE_PASSWORD_FN CHANGE_PASSWORD_FN_A +#endif + +#endif /* ISSP_MODE != 0 */ + +SECURITY_STATUS +SEC_ENTRY +CompleteAuthToken( + __in PCtxtHandle phContext, + __in PSecBufferDesc pToken); + +typedef +SECURITY_STATUS +(SEC_ENTRY * COMPLETE_AUTH_TOKEN_FN)( + PCtxtHandle, + PSecBufferDesc); + +SECURITY_STATUS +SEC_ENTRY +DecryptMessage( + __in PCtxtHandle phContext, + __inout PSecBufferDesc pMessage, + __in ULONG MessageSeqNo, + __out_opt PULONG pfQOP); + +typedef +SECURITY_STATUS +(SEC_ENTRY * DECRYPT_MESSAGE_FN)( + PCtxtHandle, + PSecBufferDesc, + ULONG, + PULONG); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +DeleteSecurityContext( + __in PCtxtHandle phContext); + +typedef +SECURITY_STATUS +(SEC_ENTRY * DELETE_SECURITY_CONTEXT_FN)( + PCtxtHandle); + +SECURITY_STATUS +SEC_ENTRY +EncryptMessage( + __in PCtxtHandle phContext, + __in ULONG fQOP, + __inout PSecBufferDesc pMessage, + __in ULONG MessageSeqNo); + +typedef +SECURITY_STATUS +(SEC_ENTRY * ENCRYPT_MESSAGE_FN)( + PCtxtHandle, + ULONG, + PSecBufferDesc, + ULONG); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +EnumerateSecurityPackagesW( + __out PULONG pcPackages, + __deref_out PSecPkgInfoW * ppPackageInfo); +#define EnumerateSecurityPackages EnumerateSecurityPackagesW + +typedef +SECURITY_STATUS +(SEC_ENTRY * ENUMERATE_SECURITY_PACKAGES_FN_W)( + PULONG, + PSecPkgInfoW*); +#define ENUMERATE_SECURITY_PACKAGES_FN ENUMERATE_SECURITY_PACKAGES_FN_W + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +ExportSecurityContext( + __in PCtxtHandle phContext, + __in ULONG fFlags, + __out PSecBuffer pPackedContext, + __out PVOID* pToken); + +typedef +SECURITY_STATUS +(SEC_ENTRY * EXPORT_SECURITY_CONTEXT_FN)( + PCtxtHandle, + ULONG, + PSecBuffer, + PVOID*); + +SECURITY_STATUS +SEC_ENTRY +FreeContextBuffer( + __inout PVOID pvContextBuffer); + +typedef +SECURITY_STATUS +(SEC_ENTRY * FREE_CONTEXT_BUFFER_FN)( + __inout PVOID); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +FreeCredentialsHandle( + __in PCredHandle phCredential); + +typedef +SECURITY_STATUS +(SEC_ENTRY * FREE_CREDENTIALS_HANDLE_FN)( + PCredHandle); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +ImpersonateSecurityContext( + __in PCtxtHandle phContext); + +typedef +SECURITY_STATUS +(SEC_ENTRY * IMPERSONATE_SECURITY_CONTEXT_FN)( + PCtxtHandle); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +ImportSecurityContextW( + __in PSSPI_SEC_STRING pszPackage, + __in PSecBuffer pPackedContext, + __in PVOID Token, + __out PCtxtHandle phContext); +#define ImportSecurityContext ImportSecurityContextW + +typedef +SECURITY_STATUS +(SEC_ENTRY * IMPORT_SECURITY_CONTEXT_FN_W)( + PSSPI_SEC_STRING, + PSecBuffer, + PVOID, + PCtxtHandle); +#define IMPORT_SECURITY_CONTEXT_FN IMPORT_SECURITY_CONTEXT_FN_W + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +InitializeSecurityContextW( + __in_opt PCredHandle phCredential, + __in_opt PCtxtHandle phContext, + __in_opt PSSPI_SEC_STRING pTargetName, + __in ULONG fContextReq, + __in ULONG Reserved1, + __in ULONG TargetDataRep, + __in_opt PSecBufferDesc pInput, + __in ULONG Reserved2, + __inout_opt PCtxtHandle phNewContext, + __inout_opt PSecBufferDesc pOutput, + __out PULONG pfContextAttr, + __out_opt PTimeStamp ptsExpiry); +#define InitializeSecurityContext InitializeSecurityContextW + +typedef +SECURITY_STATUS +(SEC_ENTRY * INITIALIZE_SECURITY_CONTEXT_FN_W)( + PCredHandle, + PCtxtHandle, + PSSPI_SEC_STRING, + ULONG, + ULONG, + ULONG, + PSecBufferDesc, + ULONG, + PCtxtHandle, + PSecBufferDesc, + PULONG, + PTimeStamp); +#define INITIALIZE_SECURITY_CONTEXT_FN INITIALIZE_SECURITY_CONTEXT_FN_W + +KSECDDDECLSPEC +PSecurityFunctionTableW +SEC_ENTRY +InitSecurityInterfaceW(VOID); +#define InitSecurityInterface InitSecurityInterfaceW + +typedef +PSecurityFunctionTableW +(SEC_ENTRY * INIT_SECURITY_INTERFACE_W)(VOID); +#define INIT_SECURITY_INTERFACE INIT_SECURITY_INTERFACE_W + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +MakeSignature( + __in PCtxtHandle phContext, + __in ULONG fQOP, + __in PSecBufferDesc pMessage, + __in ULONG MessageSeqNo); + +typedef +SECURITY_STATUS +(SEC_ENTRY * MAKE_SIGNATURE_FN)( + PCtxtHandle, + ULONG, + PSecBufferDesc, + ULONG); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +QueryContextAttributesW( + __in PCtxtHandle phContext, + __in ULONG ulAttribute, + __out PVOID pBuffer); +#define QueryContextAttributes QueryContextAttributesW + +typedef +SECURITY_STATUS +(SEC_ENTRY * QUERY_CONTEXT_ATTRIBUTES_FN_W)( + PCtxtHandle, + ULONG, + PVOID); +#define QUERY_CONTEXT_ATTRIBUTES_FN QUERY_CONTEXT_ATTRIBUTES_FN_W + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +QueryCredentialsAttributesW( + __in PCredHandle phCredential, + __in ULONG ulAttribute, + __inout PVOID pBuffer); +#define QueryCredentialsAttributes QueryCredentialsAttributesW + +typedef +SECURITY_STATUS +(SEC_ENTRY * QUERY_CREDENTIALS_ATTRIBUTES_FN_W)( + PCredHandle, + ULONG, + PVOID); +#define QUERY_CREDENTIALS_ATTRIBUTES_FN QUERY_CREDENTIALS_ATTRIBUTES_FN_W + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +QuerySecurityContextToken( + __in PCtxtHandle phContext, + __out PVOID * Token); + +typedef +SECURITY_STATUS +(SEC_ENTRY * QUERY_SECURITY_CONTEXT_TOKEN_FN)( + PCtxtHandle, PVOID *); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +QuerySecurityPackageInfoW( + __in PSSPI_SEC_STRING pPackageName, + __deref_out PSecPkgInfoW *ppPackageInfo); +#define QuerySecurityPackageInfo QuerySecurityPackageInfoW + +typedef +SECURITY_STATUS +(SEC_ENTRY * QUERY_SECURITY_PACKAGE_INFO_FN_W)( + PSSPI_SEC_STRING, + PSecPkgInfoW *); +#define QUERY_SECURITY_PACKAGE_INFO_FN QUERY_SECURITY_PACKAGE_INFO_FN_W + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +RevertSecurityContext( + __in PCtxtHandle phContext); + +typedef +SECURITY_STATUS +(SEC_ENTRY * REVERT_SECURITY_CONTEXT_FN)( + PCtxtHandle); + +#if (OSVER(NTDDI_VERSION) > NTDDI_WIN2K) +SECURITY_STATUS +SEC_ENTRY +SetContextAttributesW( + __in PCtxtHandle phContext, + __in ULONG ulAttribute, + __in_bcount(cbBuffer) PVOID pBuffer, + __in ULONG cbBuffer); +#define SetContextAttributes SetContextAttributesW + +typedef +SECURITY_STATUS +(SEC_ENTRY * SET_CONTEXT_ATTRIBUTES_FN_W)( + PCtxtHandle, + ULONG, + PVOID, + ULONG); +#define SET_CONTEXT_ATTRIBUTES_FN SET_CONTEXT_ATTRIBUTES_FN_W +#endif + +#if (NTDDI_VERSION > NTDDI_WS03) +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +SetCredentialsAttributesW( + __in PCredHandle phCredential, + __in ULONG ulAttribute, + __in_bcount(cbBuffer) PVOID pBuffer, + __in ULONG cbBuffer); +#define SetCredentialsAttributes SetCredentialsAttributesW + +typedef +SECURITY_STATUS +(SEC_ENTRY * SET_CREDENTIALS_ATTRIBUTES_FN_W)( + PCredHandle, + ULONG, + PVOID, + ULONG); +#define SET_CREDENTIALS_ATTRIBUTES_FN SET_CREDENTIALS_ATTRIBUTES_FN_W +#endif /* NTDDI_VERSION > NTDDI_WS03 */ + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +VerifySignature( + __in PCtxtHandle phContext, + __in PSecBufferDesc pMessage, + __in ULONG MessageSeqNo, + __out PULONG pfQOP); + +typedef +SECURITY_STATUS +(SEC_ENTRY * VERIFY_SIGNATURE_FN)( + PCtxtHandle, + PSecBufferDesc, + ULONG, + PULONG); + + +#if (ISSP_MODE == 0) + +KSECDDDECLSPEC +NTSTATUS +NTAPI +SecMakeSPN( + __in PUNICODE_STRING ServiceClass, + __in PUNICODE_STRING ServiceName, + __in_opt PUNICODE_STRING InstanceName, + __in_opt USHORT InstancePort, + __in_opt PUNICODE_STRING Referrer, + __inout PUNICODE_STRING Spn, + __out_opt PULONG Length, + __in BOOLEAN Allocate); + +#if (NTDDI_VERSION >= NTDDI_WINXP) +KSECDDDECLSPEC +NTSTATUS +NTAPI +SecMakeSPNEx( + __in PUNICODE_STRING ServiceClass, + __in PUNICODE_STRING ServiceName, + __in_opt PUNICODE_STRING InstanceName, + __in_opt USHORT InstancePort, + __in_opt PUNICODE_STRING Referrer, + __in_opt PUNICODE_STRING TargetInfo, + __inout PUNICODE_STRING Spn, + __out PULONG Length OPTIONAL, + __in BOOLEAN Allocate); + +KSECDDDECLSPEC +NTSTATUS +SEC_ENTRY +SecLookupAccountSid( + __in PSID Sid, + __out PULONG NameSize, + __inout PUNICODE_STRING NameBuffer, + __out PULONG DomainSize OPTIONAL, + __out_opt PUNICODE_STRING DomainBuffer, + __out PSID_NAME_USE NameUse + ); + +KSECDDDECLSPEC +NTSTATUS +SEC_ENTRY +SecLookupAccountName( + __in PUNICODE_STRING Name, + __inout PULONG SidSize, + __out PSID Sid, + __out PSID_NAME_USE NameUse, + __out_opt PULONG DomainSize, // WDK says __out only + ... OPTIONAL + __inout_opt PUNICODE_STRING ReferencedDomain); +#endif + +#if (NTDDI_VERSION >= NTDDI_WS03) +KSECDDDECLSPEC +NTSTATUS +SEC_ENTRY +SecLookupWellKnownSid( + __in WELL_KNOWN_SID_TYPE SidType, + __out PSID Sid, + __in ULONG SidBufferSize, + __inout_opt PULONG SidSize); +#endif + +#if (NTDDI_VERSION >= NTDDI_VISTA) +KSECDDDECLSPEC +NTSTATUS +NTAPI +SecMakeSPNEx2( + __in PUNICODE_STRING ServiceClass, + __in PUNICODE_STRING ServiceName, + __in_opt PUNICODE_STRING InstanceName, + __in_opt USHORT InstancePort, + __in_opt PUNICODE_STRING Referrer, + __in_opt PUNICODE_STRING InTargetInfo, + __inout PUNICODE_STRING Spn, + __out_opt PULONG TotalSize, + __in BOOLEAN Allocate, + __in BOOLEAN IsTargetInfoMarshaled); +#endif + +#endif /* ISSP_MODE == 0 */ + +#if (NTDDI_VERSION >= NTDDI_WIN7) + +SECURITY_STATUS +SEC_ENTRY +SspiEncodeAuthIdentityAsStrings( + __in PSEC_WINNT_AUTH_IDENTITY_OPAQUE pAuthIdentity, + __deref_out_opt PCWSTR* ppszUserName, + __deref_out_opt PCWSTR* ppszDomainName, + __deref_opt_out_opt PCWSTR* ppszPackedCredentialsString); + +SECURITY_STATUS +SEC_ENTRY +SspiValidateAuthIdentity( + __in PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData); + +SECURITY_STATUS +SEC_ENTRY +SspiCopyAuthIdentity( + __in PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData, + __deref_out PSEC_WINNT_AUTH_IDENTITY_OPAQUE* AuthDataCopy); + +VOID +SEC_ENTRY +SspiFreeAuthIdentity( + __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData); + +VOID +SEC_ENTRY +SspiZeroAuthIdentity( + __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData); + +VOID +SEC_ENTRY +SspiLocalFree( + __in_opt PVOID DataBuffer); + +SECURITY_STATUS +SEC_ENTRY +SspiEncodeStringsAsAuthIdentity( + __in_opt PCWSTR pszUserName, + __in_opt PCWSTR pszDomainName, + __in_opt PCWSTR pszPackedCredentialsString, + __deref_out PSEC_WINNT_AUTH_IDENTITY_OPAQUE* ppAuthIdentity); + +SECURITY_STATUS +SEC_ENTRY +SspiCompareAuthIdentities( + __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity1, + __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity2, + __out_opt PBOOLEAN SameSuppliedUser, + __out_opt PBOOLEAN SameSuppliedIdentity); + +SECURITY_STATUS +SEC_ENTRY +SspiMarshalAuthIdentity( + __in PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity, + __out PULONG AuthIdentityLength, + __deref_out_bcount(*AuthIdentityLength) PCHAR* AuthIdentityByteArray); + +SECURITY_STATUS +SEC_ENTRY +SspiUnmarshalAuthIdentity( + __in PULONG AuthIdentityLength, + __in_bcount(AuthIdentityLength) PCHAR AuthIdentityByteArray, + __deref_out PSEC_WINNT_AUTH_IDENTITY_OPAQUE* ppAuthIdentity); + +BOOLEAN +SEC_ENTRY +SspiIsPromptingNeeded( + __in PULONG ErrorOrNtStatus); + +SECURITY_STATUS +SEC_ENTRY +SspiGetTargetHostName( + __in PCWSTR pszTargetName, + __deref_out PWSTR* pszHostName); + +SECURITY_STATUS +SEC_ENTRY +SspiExcludePackage( + __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity, + __in PCWSTR pszPackageName, + __deref_out PSEC_WINNT_AUTH_IDENTITY_OPAQUE* ppNewAuthIdentity); + +#define SEC_WINNT_AUTH_IDENTITY_MARSHALLED 0x04 +#define SEC_WINNT_AUTH_IDENTITY_ONLY 0x08 + +#endif /* NTDDI_VERSION >= NTDDI_WIN7 */ + +#define FreeCredentialHandle FreeCredentialsHandle +struct _SECURITY_FUNCTION_TABLE_W +{ + ULONG dwVersion; + ENUMERATE_SECURITY_PACKAGES_FN_W EnumerateSecurityPackagesW; + QUERY_CREDENTIALS_ATTRIBUTES_FN_W QueryCredentialsAttributesW; + ACQUIRE_CREDENTIALS_HANDLE_FN_W AcquireCredentialsHandleW; + FREE_CREDENTIALS_HANDLE_FN FreeCredentialsHandle; + PVOID Reserved2; + INITIALIZE_SECURITY_CONTEXT_FN_W InitializeSecurityContextW; + ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext; + COMPLETE_AUTH_TOKEN_FN CompleteAuthToken; + DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext; + APPLY_CONTROL_TOKEN_FN ApplyControlToken; + QUERY_CONTEXT_ATTRIBUTES_FN_W QueryContextAttributesW; + IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext; + REVERT_SECURITY_CONTEXT_FN RevertSecurityContext; + MAKE_SIGNATURE_FN MakeSignature; + VERIFY_SIGNATURE_FN VerifySignature; + FREE_CONTEXT_BUFFER_FN FreeContextBuffer; + QUERY_SECURITY_PACKAGE_INFO_FN_W QuerySecurityPackageInfoW; + PVOID Reserved3; + PVOID Reserved4; + EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext; + IMPORT_SECURITY_CONTEXT_FN_W ImportSecurityContextW; + ADD_CREDENTIALS_FN_W AddCredentialsW ; + PVOID Reserved8; + QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken; + ENCRYPT_MESSAGE_FN EncryptMessage; + DECRYPT_MESSAGE_FN DecryptMessage; +#if OSVER(NTDDI_VERSION) > NTDDI_WIN2K + SET_CONTEXT_ATTRIBUTES_FN_W SetContextAttributesW; +#endif +#if NTDDI_VERSION > NTDDI_WS03SP1 + SET_CREDENTIALS_ATTRIBUTES_FN_W SetCredentialsAttributesW; +#endif +#if ISSP_MODE != 0 + CHANGE_PASSWORD_FN_W ChangeAccountPasswordW; +#else + PVOID Reserved9; +#endif +}; + +#endif /* !__SSPI_H__ */ /* #if !defined(_X86AMD64_) FIXME : WHAT ?! */ #if defined(_WIN64) - C_ASSERT(sizeof(ERESOURCE) == 0x68); C_ASSERT(FIELD_OFFSET(ERESOURCE,ActiveCount) == 0x18); C_ASSERT(FIELD_OFFSET(ERESOURCE,Flag) == 0x1a); - #else - C_ASSERT(sizeof(ERESOURCE) == 0x38); C_ASSERT(FIELD_OFFSET(ERESOURCE,ActiveCount) == 0x0c); C_ASSERT(FIELD_OFFSET(ERESOURCE,Flag) == 0x0e); - #endif /* #endif */ Modified: trunk/reactos/include/xdk/ntifs.template.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/ntifs.template…
============================================================================== --- trunk/reactos/include/xdk/ntifs.template.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/ntifs.template.h [iso-8859-1] Tue Jan 3 19:42:58 2012 @@ -1079,20 +1079,17 @@ $include (cctypes.h) $include (ccfuncs.h) $include (zwfuncs.h) +$include (sspi.h) /* #if !defined(_X86AMD64_) FIXME : WHAT ?! */ #if defined(_WIN64) - C_ASSERT(sizeof(ERESOURCE) == 0x68); C_ASSERT(FIELD_OFFSET(ERESOURCE,ActiveCount) == 0x18); C_ASSERT(FIELD_OFFSET(ERESOURCE,Flag) == 0x1a); - #else - C_ASSERT(sizeof(ERESOURCE) == 0x38); C_ASSERT(FIELD_OFFSET(ERESOURCE,ActiveCount) == 0x0c); C_ASSERT(FIELD_OFFSET(ERESOURCE,Flag) == 0x0e); - #endif /* #endif */ @@ -1271,9 +1268,6 @@ #endif #include "csq.h" - -extern PACL SePublicDefaultDacl; -extern PACL SeSystemDefaultDacl; #define FS_LFN_APIS 0x00004000 Modified: trunk/reactos/include/xdk/rtlfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/rtlfuncs.h?rev…
============================================================================== --- trunk/reactos/include/xdk/rtlfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/rtlfuncs.h [iso-8859-1] Tue Jan 3 19:42:58 2012 @@ -1953,7 +1953,7 @@ if ((Length -= 1) == 0) { return; } - Address += 1; + Address += 1; } __stosq((PULONG64)(Address), Pattern | ((ULONG64)Pattern << 32), Length / 2); if ((Length & 1) != 0) Address[Length - 1] = Pattern; Added: trunk/reactos/include/xdk/sspi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/sspi.h?rev=548…
============================================================================== --- trunk/reactos/include/xdk/sspi.h (added) +++ trunk/reactos/include/xdk/sspi.h [iso-8859-1] Tue Jan 3 19:42:58 2012 @@ -1,0 +1,1309 @@ +#ifndef __SSPI_H__ +#define __SSPI_H__ + +// for ntifs.h: +#define ISSP_LEVEL 32 +#define ISSP_MODE 0 + +#ifdef MIDL_PASS +#define MIDL_PROP(x) x +#else +#define MIDL_PROP(x) +#endif + +#define SEC_TEXT TEXT +#define SEC_FAR +#define SEC_ENTRY __stdcall + +#if defined(_NO_KSECDD_IMPORT_) +#define KSECDDDECLSPEC +#else +#define KSECDDDECLSPEC __declspec(dllimport) +#endif + +#define SECQOP_WRAP_NO_ENCRYPT 0x80000001 +#define SECQOP_WRAP_OOB_DATA 0x40000000 + +#define SECURITY_ENTRYPOINTW SEC_TEXT("InitSecurityInterfaceW") +#define SECURITY_ENTRYPOINT SECURITY_ENTRYPOINTW + +#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION 1 +#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2 2 +#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_3 3 +#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_4 4 + +#define SECURITY_NATIVE_DREP 0x00000010 +#define SECURITY_NETWORK_DREP 0x00000000 + +#define SECPKG_ID_NONE 0xFFFF + +#define SECPKG_CRED_ATTR_NAMES 1 +#define SECPKG_CRED_ATTR_SSI_PROVIDER 2 + +#define SECPKG_ATTR_SIZES 0 +#define SECPKG_ATTR_NAMES 1 +#define SECPKG_ATTR_LIFESPAN 2 +#define SECPKG_ATTR_DCE_INFO 3 +#define SECPKG_ATTR_STREAM_SIZES 4 +#define SECPKG_ATTR_KEY_INFO 5 +#define SECPKG_ATTR_AUTHORITY 6 +#define SECPKG_ATTR_PROTO_INFO 7 +#define SECPKG_ATTR_PASSWORD_EXPIRY 8 +#define SECPKG_ATTR_SESSION_KEY 9 +#define SECPKG_ATTR_PACKAGE_INFO 10 +#define SECPKG_ATTR_USER_FLAGS 11 +#define SECPKG_ATTR_NEGOTIATION_INFO 12 +#define SECPKG_ATTR_NATIVE_NAMES 13 +#define SECPKG_ATTR_FLAGS 14 +#define SECPKG_ATTR_USE_VALIDATED 15 +#define SECPKG_ATTR_CREDENTIAL_NAME 16 +#define SECPKG_ATTR_TARGET_INFORMATION 17 +#define SECPKG_ATTR_ACCESS_TOKEN 18 +#define SECPKG_ATTR_TARGET 19 +#define SECPKG_ATTR_AUTHENTICATION_ID 20 +#define SECPKG_ATTR_LOGOFF_TIME 21 +#define SECPKG_ATTR_NEGO_KEYS 22 +#define SECPKG_ATTR_PROMPTING_NEEDED 24 +#define SECPKG_ATTR_UNIQUE_BINDINGS 25 +#define SECPKG_ATTR_ENDPOINT_BINDINGS 26 +#define SECPKG_ATTR_CLIENT_SPECIFIED_TARGET 27 +#define SECPKG_ATTR_LAST_CLIENT_TOKEN_STATUS 30 +#define SECPKG_ATTR_NEGO_PKG_INFO 31 +#define SECPKG_ATTR_NEGO_STATUS 32 +#define SECPKG_ATTR_CONTEXT_DELETED 33 + +#define SECPKG_FLAG_INTEGRITY 0x00000001 +#define SECPKG_FLAG_PRIVACY 0x00000002 +#define SECPKG_FLAG_TOKEN_ONLY 0x00000004 +#define SECPKG_FLAG_DATAGRAM 0x00000008 +#define SECPKG_FLAG_CONNECTION 0x00000010 +#define SECPKG_FLAG_MULTI_REQUIRED 0x00000020 +#define SECPKG_FLAG_CLIENT_ONLY 0x00000040 +#define SECPKG_FLAG_EXTENDED_ERROR 0x00000080 +#define SECPKG_FLAG_IMPERSONATION 0x00000100 +#define SECPKG_FLAG_ACCEPT_WIN32_NAME 0x00000200 +#define SECPKG_FLAG_STREAM 0x00000400 +#define SECPKG_FLAG_NEGOTIABLE 0x00000800 +#define SECPKG_FLAG_GSS_COMPATIBLE 0x00001000 +#define SECPKG_FLAG_LOGON 0x00002000 +#define SECPKG_FLAG_ASCII_BUFFERS 0x00004000 +#define SECPKG_FLAG_FRAGMENT 0x00008000 +#define SECPKG_FLAG_MUTUAL_AUTH 0x00010000 +#define SECPKG_FLAG_DELEGATION 0x00020000 +#define SECPKG_FLAG_READONLY_WITH_CHECKSUM 0x00040000 +#define SECPKG_FLAG_RESTRICTED_TOKENS 0x00080000 +#define SECPKG_FLAG_NEGO_EXTENDER 0x00100000 +#define SECPKG_FLAG_NEGOTIABLE2 0x00200000 + +#define SECPKG_CRED_INBOUND 0x00000001 +#define SECPKG_CRED_OUTBOUND 0x00000002 +#define SECPKG_CRED_BOTH 0x00000003 +#define SECPKG_CRED_DEFAULT 0x00000004 +#define SECPKG_CRED_RESERVED 0xF0000000 +#define SECPKG_CRED_AUTOLOGON_RESTRICTED 0x00000010 +#define SECPKG_CRED_PROCESS_POLICY_ONLY 0x00000020 + +#define SECPKG_CONTEXT_EXPORT_RESET_NEW 0x00000001 +#define SECPKG_CONTEXT_EXPORT_DELETE_OLD 0x00000002 +#define SECPKG_CONTEXT_EXPORT_TO_KERNEL 0x00000004 + +#define SECPKG_ATTR_SUBJECT_SECURITY_ATTRIBUTES 128 +#define SECPKG_ATTR_NEGO_INFO_FLAG_NO_KERBEROS 0x1 +#define SECPKG_ATTR_NEGO_INFO_FLAG_NO_NTLM 0x2 + +#define SecPkgContext_NativeNames SecPkgContext_NativeNamesW +#define PSecPkgContext_NativeNames PSecPkgContext_NativeNamesW + +#define SECBUFFER_VERSION 0 + +#define SECBUFFER_EMPTY 0 +#define SECBUFFER_DATA 1 +#define SECBUFFER_TOKEN 2 +#define SECBUFFER_PKG_PARAMS 3 +#define SECBUFFER_MISSING 4 +#define SECBUFFER_EXTRA 5 +#define SECBUFFER_STREAM_TRAILER 6 +#define SECBUFFER_STREAM_HEADER 7 +#define SECBUFFER_NEGOTIATION_INFO 8 +#define SECBUFFER_PADDING 9 +#define SECBUFFER_STREAM 10 +#define SECBUFFER_MECHLIST 11 +#define SECBUFFER_MECHLIST_SIGNATURE 12 +#define SECBUFFER_TARGET 13 +#define SECBUFFER_CHANNEL_BINDINGS 14 +#define SECBUFFER_CHANGE_PASS_RESPONSE 15 +#define SECBUFFER_TARGET_HOST 16 +#define SECBUFFER_ALERT 17 + +#define SECBUFFER_ATTRMASK 0xF0000000 +#define SECBUFFER_READONLY 0x80000000 +#define SECBUFFER_READONLY_WITH_CHECKSUM 0x10000000 +#define SECBUFFER_RESERVED 0x60000000 + +#define ISC_REQ_DELEGATE 0x00000001 +#define ISC_REQ_MUTUAL_AUTH 0x00000002 +#define ISC_REQ_REPLAY_DETECT 0x00000004 +#define ISC_REQ_SEQUENCE_DETECT 0x00000008 +#define ISC_REQ_CONFIDENTIALITY 0x00000010 +#define ISC_REQ_USE_SESSION_KEY 0x00000020 +#define ISC_REQ_PROMPT_FOR_CREDS 0x00000040 +#define ISC_REQ_USE_SUPPLIED_CREDS 0x00000080 +#define ISC_REQ_ALLOCATE_MEMORY 0x00000100 +#define ISC_REQ_USE_DCE_STYLE 0x00000200 +#define ISC_REQ_DATAGRAM 0x00000400 +#define ISC_REQ_CONNECTION 0x00000800 +#define ISC_REQ_CALL_LEVEL 0x00001000 +#define ISC_REQ_FRAGMENT_SUPPLIED 0x00002000 +#define ISC_REQ_EXTENDED_ERROR 0x00004000 +#define ISC_REQ_STREAM 0x00008000 +#define ISC_REQ_INTEGRITY 0x00010000 +#define ISC_REQ_IDENTIFY 0x00020000 +#define ISC_REQ_NULL_SESSION 0x00040000 +#define ISC_REQ_MANUAL_CRED_VALIDATION 0x00080000 +#define ISC_REQ_RESERVED1 0x00100000 +#define ISC_REQ_FRAGMENT_TO_FIT 0x00200000 +#define ISC_REQ_FORWARD_CREDENTIALS 0x00400000 +#define ISC_REQ_NO_INTEGRITY 0x00800000 +#define ISC_REQ_USE_HTTP_STYLE 0x01000000 + +#define ISC_RET_DELEGATE 0x00000001 +#define ISC_RET_MUTUAL_AUTH 0x00000002 +#define ISC_RET_REPLAY_DETECT 0x00000004 +#define ISC_RET_SEQUENCE_DETECT 0x00000008 +#define ISC_RET_CONFIDENTIALITY 0x00000010 +#define ISC_RET_USE_SESSION_KEY 0x00000020 +#define ISC_RET_USED_COLLECTED_CREDS 0x00000040 +#define ISC_RET_USED_SUPPLIED_CREDS 0x00000080 +#define ISC_RET_ALLOCATED_MEMORY 0x00000100 +#define ISC_RET_USED_DCE_STYLE 0x00000200 +#define ISC_RET_DATAGRAM 0x00000400 +#define ISC_RET_CONNECTION 0x00000800 +#define ISC_RET_INTERMEDIATE_RETURN 0x00001000 +#define ISC_RET_CALL_LEVEL 0x00002000 +#define ISC_RET_EXTENDED_ERROR 0x00004000 +#define ISC_RET_STREAM 0x00008000 +#define ISC_RET_INTEGRITY 0x00010000 +#define ISC_RET_IDENTIFY 0x00020000 +#define ISC_RET_NULL_SESSION 0x00040000 +#define ISC_RET_MANUAL_CRED_VALIDATION 0x00080000 +#define ISC_RET_RESERVED1 0x00100000 +#define ISC_RET_FRAGMENT_ONLY 0x00200000 +#define ISC_RET_FORWARD_CREDENTIALS 0x00400000 +#define ISC_RET_USED_HTTP_STYLE 0x01000000 +#define ISC_RET_NO_ADDITIONAL_TOKEN 0x02000000 +#define ISC_RET_REAUTHENTICATION 0x08000000 + +#define ASC_REQ_DELEGATE 0x00000001 +#define ASC_REQ_MUTUAL_AUTH 0x00000002 +#define ASC_REQ_REPLAY_DETECT 0x00000004 +#define ASC_REQ_SEQUENCE_DETECT 0x00000008 +#define ASC_REQ_CONFIDENTIALITY 0x00000010 +#define ASC_REQ_USE_SESSION_KEY 0x00000020 +#define ASC_REQ_ALLOCATE_MEMORY 0x00000100 +#define ASC_REQ_USE_DCE_STYLE 0x00000200 +#define ASC_REQ_DATAGRAM 0x00000400 +#define ASC_REQ_CONNECTION 0x00000800 +#define ASC_REQ_CALL_LEVEL 0x00001000 +#define ASC_REQ_EXTENDED_ERROR 0x00008000 +#define ASC_REQ_STREAM 0x00010000 +#define ASC_REQ_INTEGRITY 0x00020000 +#define ASC_REQ_LICENSING 0x00040000 +#define ASC_REQ_IDENTIFY 0x00080000 +#define ASC_REQ_ALLOW_NULL_SESSION 0x00100000 +#define ASC_REQ_ALLOW_NON_USER_LOGONS 0x00200000 +#define ASC_REQ_ALLOW_CONTEXT_REPLAY 0x00400000 +#define ASC_REQ_FRAGMENT_TO_FIT 0x00800000 +#define ASC_REQ_FRAGMENT_SUPPLIED 0x00002000 +#define ASC_REQ_NO_TOKEN 0x01000000 +#define ASC_REQ_PROXY_BINDINGS 0x04000000 +//#define SSP_RET_REAUTHENTICATION 0x08000000 // internal + +#define ASC_REQ_ALLOW_MISSING_BINDINGS 0x10000000 +#define ASC_RET_DELEGATE 0x00000001 +#define ASC_RET_MUTUAL_AUTH 0x00000002 +#define ASC_RET_REPLAY_DETECT 0x00000004 +#define ASC_RET_SEQUENCE_DETECT 0x00000008 +#define ASC_RET_CONFIDENTIALITY 0x00000010 +#define ASC_RET_USE_SESSION_KEY 0x00000020 +#define ASC_RET_ALLOCATED_MEMORY 0x00000100 +#define ASC_RET_USED_DCE_STYLE 0x00000200 +#define ASC_RET_DATAGRAM 0x00000400 +#define ASC_RET_CONNECTION 0x00000800 +#define ASC_RET_CALL_LEVEL 0x00002000 +#define ASC_RET_THIRD_LEG_FAILED 0x00004000 +#define ASC_RET_EXTENDED_ERROR 0x00008000 +#define ASC_RET_STREAM 0x00010000 +#define ASC_RET_INTEGRITY 0x00020000 +#define ASC_RET_LICENSING 0x00040000 +#define ASC_RET_IDENTIFY 0x00080000 +#define ASC_RET_NULL_SESSION 0x00100000 +#define ASC_RET_ALLOW_NON_USER_LOGONS 0x00200000 +#define ASC_RET_ALLOW_CONTEXT_REPLAY 0x00400000 +#define ASC_RET_FRAGMENT_ONLY 0x00800000 +#define ASC_RET_NO_TOKEN 0x01000000 +#define ASC_RET_NO_ADDITIONAL_TOKEN 0x02000000 +#define ASC_RET_NO_PROXY_BINDINGS 0x04000000 +//#define SSP_RET_REAUTHENTICATION 0x08000000 // internal +#define ASC_RET_MISSING_BINDINGS 0x10000000 + +#define SEC_DELETED_HANDLE ((ULONG_PTR)(-2)) + +#define SecInvalidateHandle(x) \ + ((PSecHandle)(x))->dwLower = ((PSecHandle)(x))->dwUpper = ((ULONG_PTR)((INT_PTR)-1)); + +#define SecIsValidHandle(x) \ + ( ( ((PSecHandle)(x))->dwLower != (ULONG_PTR)(INT_PTR)-1 ) && \ + ( ((PSecHandle)(x))->dwUpper != (ULONG_PTR)(INT_PTR)-1 ) ) + +typedef WCHAR SEC_WCHAR; +typedef CHAR SEC_CHAR; +typedef LARGE_INTEGER _SECURITY_INTEGER, SECURITY_INTEGER, *PSECURITY_INTEGER; +typedef SECURITY_INTEGER TimeStamp, *PTimeStamp; +typedef UNICODE_STRING SECURITY_STRING, *PSECURITY_STRING; +#if ISSP_MODE == 0 +#define PSSPI_SEC_STRING PSECURITY_STRING +#else +#define PSSPI_SEC_STRING SEC_WCHAR* +#endif + +typedef PVOID PSEC_WINNT_AUTH_IDENTITY_OPAQUE; + +#ifndef __SECSTATUS_DEFINED__ +typedef LONG SECURITY_STATUS; +#define __SECSTATUS_DEFINED__ +#endif + +typedef enum _SECPKG_CRED_CLASS +{ + SecPkgCredClass_None = 0, + SecPkgCredClass_Ephemeral = 10, + SecPkgCredClass_PersistedGeneric = 20, + SecPkgCredClass_PersistedSpecific = 30, + SecPkgCredClass_Explicit = 40, +} SECPKG_CRED_CLASS, *PSECPKG_CRED_CLASS; + +typedef struct _SEC_NEGOTIATION_INFO +{ + ULONG Size; + ULONG NameLength; + SEC_WCHAR * Name; + PVOID Reserved; +} SEC_NEGOTIATION_INFO, *PSEC_NEGOTIATION_INFO; + +typedef struct _SEC_CHANNEL_BINDINGS +{ + ULONG dwInitiatorAddrType; + ULONG cbInitiatorLength; + ULONG dwInitiatorOffset; + ULONG dwAcceptorAddrType; + ULONG cbAcceptorLength; + ULONG dwAcceptorOffset; + ULONG cbApplicationDataLength; + ULONG dwApplicationDataOffset; +} SEC_CHANNEL_BINDINGS, *PSEC_CHANNEL_BINDINGS; + +#ifndef _AUTH_IDENTITY_EX2_DEFINED +#define _AUTH_IDENTITY_EX2_DEFINED +typedef struct _SEC_WINNT_AUTH_IDENTITY_EX2 { + ULONG Version; + USHORT cbHeaderLength; + ULONG cbStructureLength; + ULONG UserOffset; + USHORT UserLength; + ULONG DomainOffset; + USHORT DomainLength; + ULONG PackedCredentialsOffset; + USHORT PackedCredentialsLength; + ULONG Flags; + ULONG PackageListOffset; + USHORT PackageListLength; +} SEC_WINNT_AUTH_IDENTITY_EX2, *PSEC_WINNT_AUTH_IDENTITY_EX2; +#define SEC_WINNT_AUTH_IDENTITY_VERSION_2 0x201 +#endif + +#ifndef _AUTH_IDENTITY_DEFINED +#define _AUTH_IDENTITY_DEFINED +typedef struct _SEC_WINNT_AUTH_IDENTITY_W { + PUSHORT User; + ULONG UserLength; + PUSHORT Domain; + ULONG DomainLength; + PUSHORT Password; + ULONG PasswordLength; + ULONG Flags; +} SEC_WINNT_AUTH_IDENTITY_W, *PSEC_WINNT_AUTH_IDENTITY_W; +#define SEC_WINNT_AUTH_IDENTITY_ANSI 0x1 +#define SEC_WINNT_AUTH_IDENTITY_UNICODE 0x2 +#define SEC_WINNT_AUTH_IDENTITY SEC_WINNT_AUTH_IDENTITY_W +#define PSEC_WINNT_AUTH_IDENTITY PSEC_WINNT_AUTH_IDENTITY_W +#define _SEC_WINNT_AUTH_IDENTITY _SEC_WINNT_AUTH_IDENTITY_W +#endif + +#ifndef SEC_WINNT_AUTH_IDENTITY_VERSION +#define SEC_WINNT_AUTH_IDENTITY_VERSION 0x200 +typedef struct _SEC_WINNT_AUTH_IDENTITY_EXW { + ULONG Version; + ULONG Length; + PUSHORT User; // Non-NULL terminated string. + ULONG UserLength; // # of characters (NOT bytes), not including NULL. + PUSHORT Domain; // Non-NULL terminated string. + ULONG DomainLength; // # of characters (NOT bytes), not including NULL. + PUSHORT Password; // Non-NULL terminated string. + ULONG PasswordLength; // # of characters (NOT bytes), not including NULL. + ULONG Flags; + PUSHORT PackageList; + ULONG PackageListLength; +} SEC_WINNT_AUTH_IDENTITY_EXW, *PSEC_WINNT_AUTH_IDENTITY_EXW; +#define SEC_WINNT_AUTH_IDENTITY_EX SEC_WINNT_AUTH_IDENTITY_EXW +#define PSEC_WINNT_AUTH_IDENTITY_EX PSEC_WINNT_AUTH_IDENTITY_EXW +#endif + +#ifndef __SECHANDLE_DEFINED__ +typedef struct _SecHandle +{ + ULONG_PTR dwLower; + ULONG_PTR dwUpper; +} SecHandle, *PSecHandle; +#define __SECHANDLE_DEFINED__ +#endif + +typedef SecHandle CredHandle, *PCredHandle, CtxtHandle, *PCtxtHandle; + +typedef struct _SecBuffer +{ + ULONG cbBuffer; + ULONG BufferType; +#ifdef MIDL_PASS + MIDL_PROP([size_is(cbBuffer)]) PCHAR pvBuffer; +#else + __field_bcount(cbBuffer) void SEC_FAR *pvBuffer; +#endif +} SecBuffer, * PSecBuffer; + +typedef struct _SecBufferDesc +{ + ULONG ulVersion; + ULONG cBuffers; + MIDL_PROP([size_is(cBuffers)]) __field_ecount(cBuffers) PSecBuffer pBuffers; +} SecBufferDesc, SEC_FAR * PSecBufferDesc; + +typedef struct _SecPkgInfoW +{ + ULONG fCapabilities; + USHORT wVersion; + USHORT wRPCID; + ULONG cbMaxToken; + MIDL_PROP([string]) SEC_WCHAR *Name; + MIDL_PROP([string]) SEC_WCHAR *Comment; +} SecPkgInfoW, *PSecPkgInfoW; +#define SecPkgInfo SecPkgInfoW +#define PSecPkgInfo PSecPkgInfoW + +typedef struct _SecPkgCredentials_NamesW +{ + MIDL_PROP([string]) SEC_WCHAR * sUserName; +} SecPkgCredentials_NamesW, * PSecPkgCredentials_NamesW; +#define SecPkgCredentials_Names SecPkgCredentials_NamesW +#define PSecPkgCredentials_Names PSecPkgCredentials_NamesW + +typedef struct _SecPkgContext_NamesW +{ + SEC_WCHAR *sUserName; +} SecPkgContext_NamesW, *PSecPkgContext_NamesW; +#define SecPkgContext_Names SecPkgContext_NamesW +#define PSecPkgContext_Names PSecPkgContext_NamesW + +#if OSVER(NTDDI_VERSION) > NTDDI_WIN2K +typedef struct _SecPkgContext_CredentialNameW +{ + ULONG CredentialType; + SEC_WCHAR *sCredentialName; +} SecPkgContext_CredentialNameW, *PSecPkgContext_CredentialNameW; +#endif +#define SecPkgContext_CredentialName SecPkgContext_CredentialNameW +#define PSecPkgContext_CredentialName PSecPkgContext_CredentialNameW + +typedef struct _SecPkgContext_SubjectAttributes { + PVOID AttributeInfo; +} SecPkgContext_SubjectAttributes, *PSecPkgContext_SubjectAttributes; + +typedef struct _SecPkgContext_CredInfo { + SECPKG_CRED_CLASS CredClass; + ULONG IsPromptingNeeded; +} SecPkgContext_CredInfo, *PSecPkgContext_CredInfo; + +typedef struct _SecPkgContext_NegoPackageInfo +{ + ULONG PackageMask; +} SecPkgContext_NegoPackageInfo, * PSecPkgContext_NegoPackageInfo; + +typedef struct _SecPkgContext_NegoStatus +{ + ULONG LastStatus; +} SecPkgContext_NegoStatus, *PSecPkgContext_NegoStatus; + +typedef struct _SecPkgContext_Sizes +{ + ULONG cbMaxToken; + ULONG cbMaxSignature; + ULONG cbBlockSize; + ULONG cbSecurityTrailer; +} SecPkgContext_Sizes, *PSecPkgContext_Sizes; + +typedef struct _SecPkgContext_StreamSizes +{ + ULONG cbHeader; + ULONG cbTrailer; + ULONG cbMaximumMessage; + ULONG cBuffers; + ULONG cbBlockSize; +} SecPkgContext_StreamSizes, *PSecPkgContext_StreamSizes; + +typedef struct _SecPkgContext_Lifespan +{ + TimeStamp tsStart; + TimeStamp tsExpiry; +} SecPkgContext_Lifespan, *PSecPkgContext_Lifespan; + +typedef struct _SecPkgContext_PasswordExpiry +{ + TimeStamp tsPasswordExpires; +} SecPkgContext_PasswordExpiry, * PSecPkgContext_PasswordExpiry; + +typedef struct _SecPkgContext_ProtoInfoW +{ + SEC_WCHAR *sProtocolName; + ULONG majorVersion; + ULONG minorVersion; +} SecPkgContext_ProtoInfoW, *PSecPkgContext_ProtoInfoW; +#define SecPkgContext_ProtoInfo SecPkgContext_ProtoInfoW +#define PSecPkgContext_ProtoInfo PSecPkgContext_ProtoInfoW + +typedef struct _SecPkgContext_KeyInfoW +{ + SEC_WCHAR *sSignatureAlgorithmName; + SEC_WCHAR *sEncryptAlgorithmName; + ULONG KeySize; + ULONG SignatureAlgorithm; + ULONG EncryptAlgorithm; +} SecPkgContext_KeyInfoW, *PSecPkgContext_KeyInfoW; +#define SecPkgContext_KeyInfo SecPkgContext_KeyInfoW +#define PSecPkgContext_KeyInfo PSecPkgContext_KeyInfoW + +typedef struct _SecPkgContext_SessionKey +{ + ULONG SessionKeyLength; + __field_bcount(SessionKeyLength) PUCHAR SessionKey; +} SecPkgContext_SessionKey, *PSecPkgContext_SessionKey; + +typedef struct _SecPkgContext_NegoKeys +{ + ULONG KeyType; + USHORT KeyLength; + __field_bcount(KeyLength) PUCHAR KeyValue; + ULONG VerifyKeyType; + USHORT VerifyKeyLength; + __field_bcount(VerifyKeyLength) PUCHAR VerifyKeyValue; +} SecPkgContext_NegoKeys, *PSecPkgContext_NegoKeys; + +typedef struct _SecPkgContext_DceInfo +{ + ULONG AuthzSvc; + PVOID pPac; +} SecPkgContext_DceInfo, *PSecPkgContext_DceInfo; + +typedef struct _SecPkgContext_PackageInfoW +{ + PSecPkgInfoW PackageInfo; +} SecPkgContext_PackageInfoW, *PSecPkgContext_PackageInfoW; +#define SecPkgContext_PackageInfo SecPkgContext_PackageInfoW +#define PSecPkgContext_PackageInfo PSecPkgContext_PackageInfoW + +typedef struct _SecPkgContext_UserFlags +{ + ULONG UserFlags; +} SecPkgContext_UserFlags, *PSecPkgContext_UserFlags; + +typedef struct _SecPkgContext_Flags +{ + ULONG Flags; +} SecPkgContext_Flags, *PSecPkgContext_Flags; + +typedef struct _SecPkgContext_NegotiationInfoW +{ + PSecPkgInfoW PackageInfo ; + ULONG NegotiationState ; +} SecPkgContext_NegotiationInfoW, *PSecPkgContext_NegotiationInfoW ; + +typedef struct _SecPkgContext_AuthorityW +{ + SEC_WCHAR *sAuthorityName; +} SecPkgContext_AuthorityW, *PSecPkgContext_AuthorityW; +#define SecPkgContext_Authority SecPkgContext_AuthorityW +#define PSecPkgContext_Authority PSecPkgContext_AuthorityW + + +#if NTDDI_VERSION > NTDDI_WS03 +typedef struct _SecPkgCredentials_SSIProviderW +{ + SEC_WCHAR *sProviderName; + ULONG ProviderInfoLength; + PCHAR ProviderInfo; +} SecPkgCredentials_SSIProviderW, * PSecPkgCredentials_SSIProviderW; +#define SecPkgCredentials_SSIProvider SecPkgCredentials_SSIProviderW +#define PSecPkgCredentials_SSIProvider PSecPkgCredentials_SSIProviderW + +typedef struct _SecPkgContext_LogoffTime +{ + TimeStamp tsLogoffTime; +} SecPkgContext_LogoffTime, *PSecPkgContext_LogoffTime; +#endif + +/* forward declaration */ +typedef struct _SECURITY_FUNCTION_TABLE_W SecurityFunctionTableW, * PSecurityFunctionTableW; +#define SecurityFunctionTable SecurityFunctionTableW +#define PSecurityFunctionTable PSecurityFunctionTableW + +typedef +VOID +(SEC_ENTRY * SEC_GET_KEY_FN)( + PVOID Arg, + PVOID Principal, + ULONG KeyVer, + PVOID *Key, + SECURITY_STATUS *Status); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +AcceptSecurityContext( + __in_opt PCredHandle phCredential, + __in_opt PCtxtHandle phContext, + __in_opt PSecBufferDesc pInput, + __in ULONG fContextReq, + __in ULONG TargetDataRep, + __in_opt PCtxtHandle phNewContext, + __in_opt PSecBufferDesc pOutput, + __out PULONG pfContextAttr, + __out_opt PTimeStamp ptsExpiry); + +typedef +SECURITY_STATUS +(SEC_ENTRY * ACCEPT_SECURITY_CONTEXT_FN)( + PCredHandle, + PCtxtHandle, + PSecBufferDesc, + ULONG, + ULONG, + PCtxtHandle, + PSecBufferDesc, + PULONG, + PTimeStamp); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +AcquireCredentialsHandleW( + __in_opt PSSPI_SEC_STRING pPrincipal, + __in PSSPI_SEC_STRING pPackage, + __in ULONG fCredentialUse, + __in_opt PVOID pvLogonId, + __in_opt PVOID pAuthData, + __in_opt SEC_GET_KEY_FN pGetKeyFn, + __in_opt PVOID pvGetKeyArgument, + __out PCredHandle phCredential, + __out_opt PTimeStamp ptsExpiry); +#define AcquireCredentialsHandle AcquireCredentialsHandleW + +typedef +SECURITY_STATUS +(SEC_ENTRY * ACQUIRE_CREDENTIALS_HANDLE_FN_W)( + PSSPI_SEC_STRING, + PSSPI_SEC_STRING, + ULONG, + PVOID, + PVOID, + SEC_GET_KEY_FN, + PVOID, + PCredHandle, + PTimeStamp); +#define ACQUIRE_CREDENTIALS_HANDLE_FN ACQUIRE_CREDENTIALS_HANDLE_FN_W + +SECURITY_STATUS +SEC_ENTRY +AddCredentialsA( + __in PCredHandle hCredentials, + __in_opt LPSTR pszPrincipal, + __in LPSTR pszPackage, + __in ULONG fCredentialUse, + __in_opt PVOID pAuthData, + __in_opt SEC_GET_KEY_FN pGetKeyFn, + __in_opt PVOID pvGetKeyArgument, + __out_opt PTimeStamp ptsExpiry); + +typedef +SECURITY_STATUS +(SEC_ENTRY * ADD_CREDENTIALS_FN_A)( + PCredHandle, + SEC_CHAR *, + SEC_CHAR *, + ULONG, + PVOID, + SEC_GET_KEY_FN, + PVOID, + PTimeStamp); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +AddCredentialsW( + __in PCredHandle hCredentials, + __in_opt PSSPI_SEC_STRING pPrincipal, + __in PSSPI_SEC_STRING pPackage, + __in ULONG fCredentialUse, + __in_opt PVOID pAuthData, + __in_opt SEC_GET_KEY_FN pGetKeyFn, + __in_opt PVOID pvGetKeyArgument, + __out_opt PTimeStamp ptsExpiry); + +typedef +SECURITY_STATUS +(SEC_ENTRY * ADD_CREDENTIALS_FN_W)( + PCredHandle, + PSSPI_SEC_STRING, + PSSPI_SEC_STRING, + ULONG, + PVOID, + SEC_GET_KEY_FN, + PVOID, + PTimeStamp); + +#ifdef UNICODE +#define AddCredentials AddCredentialsW +#define ADD_CREDENTIALS_FN ADD_CREDENTIALS_FN_W +#else +#define AddCredentials AddCredentialsA +#define ADD_CREDENTIALS_FN ADD_CREDENTIALS_FN_A +#endif + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +ApplyControlToken( + __in PCtxtHandle phContext, + __in PSecBufferDesc pInput); + +typedef +SECURITY_STATUS +(SEC_ENTRY * APPLY_CONTROL_TOKEN_FN)( + PCtxtHandle, PSecBufferDesc); + +#if (ISSP_MODE != 0) + +SECURITY_STATUS +SEC_ENTRY +ChangeAccountPasswordA( + __in SEC_CHAR* pszPackageName, + __in SEC_CHAR* pszDomainName, + __in SEC_CHAR* pszAccountName, + __in SEC_CHAR* pszOldPassword, + __in SEC_CHAR* pszNewPassword, + __in BOOLEAN bImpersonating, + __in ULONG dwReserved, + __inout PSecBufferDesc pOutput); + +typedef +SECURITY_STATUS +(SEC_ENTRY * CHANGE_PASSWORD_FN_A)( + SEC_CHAR *, + SEC_CHAR *, + SEC_CHAR *, + SEC_CHAR *, + SEC_CHAR *, + BOOLEAN, + ULONG, + PSecBufferDesc); + +SECURITY_STATUS +SEC_ENTRY +ChangeAccountPasswordW( + __in SEC_WCHAR* pszPackageName, + __in SEC_WCHAR* pszDomainName, + __in SEC_WCHAR* pszAccountName, + __in SEC_WCHAR* pszOldPassword, + __in SEC_WCHAR* pszNewPassword, + __in BOOLEAN bImpersonating, + __in ULONG dwReserved, + __inout PSecBufferDesc pOutput); + +typedef +SECURITY_STATUS +(SEC_ENTRY * CHANGE_PASSWORD_FN_W)( + SEC_WCHAR *, + SEC_WCHAR *, + SEC_WCHAR *, + SEC_WCHAR *, + SEC_WCHAR *, + BOOLEAN, + ULONG, + PSecBufferDesc); + +#ifdef UNICODE +#define ChangeAccountPassword ChangeAccountPasswordW +#define CHANGE_PASSWORD_FN CHANGE_PASSWORD_FN_W +#else +#define ChangeAccountPassword ChangeAccountPasswordA +#define CHANGE_PASSWORD_FN CHANGE_PASSWORD_FN_A +#endif + +#endif /* ISSP_MODE != 0 */ + +SECURITY_STATUS +SEC_ENTRY +CompleteAuthToken( + __in PCtxtHandle phContext, + __in PSecBufferDesc pToken); + +typedef +SECURITY_STATUS +(SEC_ENTRY * COMPLETE_AUTH_TOKEN_FN)( + PCtxtHandle, + PSecBufferDesc); + +SECURITY_STATUS +SEC_ENTRY +DecryptMessage( + __in PCtxtHandle phContext, + __inout PSecBufferDesc pMessage, + __in ULONG MessageSeqNo, + __out_opt PULONG pfQOP); + +typedef +SECURITY_STATUS +(SEC_ENTRY * DECRYPT_MESSAGE_FN)( + PCtxtHandle, + PSecBufferDesc, + ULONG, + PULONG); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +DeleteSecurityContext( + __in PCtxtHandle phContext); + +typedef +SECURITY_STATUS +(SEC_ENTRY * DELETE_SECURITY_CONTEXT_FN)( + PCtxtHandle); + +SECURITY_STATUS +SEC_ENTRY +EncryptMessage( + __in PCtxtHandle phContext, + __in ULONG fQOP, + __inout PSecBufferDesc pMessage, + __in ULONG MessageSeqNo); + +typedef +SECURITY_STATUS +(SEC_ENTRY * ENCRYPT_MESSAGE_FN)( + PCtxtHandle, + ULONG, + PSecBufferDesc, + ULONG); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +EnumerateSecurityPackagesW( + __out PULONG pcPackages, + __deref_out PSecPkgInfoW * ppPackageInfo); +#define EnumerateSecurityPackages EnumerateSecurityPackagesW + +typedef +SECURITY_STATUS +(SEC_ENTRY * ENUMERATE_SECURITY_PACKAGES_FN_W)( + PULONG, + PSecPkgInfoW*); +#define ENUMERATE_SECURITY_PACKAGES_FN ENUMERATE_SECURITY_PACKAGES_FN_W + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +ExportSecurityContext( + __in PCtxtHandle phContext, + __in ULONG fFlags, + __out PSecBuffer pPackedContext, + __out PVOID* pToken); + +typedef +SECURITY_STATUS +(SEC_ENTRY * EXPORT_SECURITY_CONTEXT_FN)( + PCtxtHandle, + ULONG, + PSecBuffer, + PVOID*); + +SECURITY_STATUS +SEC_ENTRY +FreeContextBuffer( + __inout PVOID pvContextBuffer); + +typedef +SECURITY_STATUS +(SEC_ENTRY * FREE_CONTEXT_BUFFER_FN)( + __inout PVOID); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +FreeCredentialsHandle( + __in PCredHandle phCredential); + +typedef +SECURITY_STATUS +(SEC_ENTRY * FREE_CREDENTIALS_HANDLE_FN)( + PCredHandle); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +ImpersonateSecurityContext( + __in PCtxtHandle phContext); + +typedef +SECURITY_STATUS +(SEC_ENTRY * IMPERSONATE_SECURITY_CONTEXT_FN)( + PCtxtHandle); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +ImportSecurityContextW( + __in PSSPI_SEC_STRING pszPackage, + __in PSecBuffer pPackedContext, + __in PVOID Token, + __out PCtxtHandle phContext); +#define ImportSecurityContext ImportSecurityContextW + +typedef +SECURITY_STATUS +(SEC_ENTRY * IMPORT_SECURITY_CONTEXT_FN_W)( + PSSPI_SEC_STRING, + PSecBuffer, + PVOID, + PCtxtHandle); +#define IMPORT_SECURITY_CONTEXT_FN IMPORT_SECURITY_CONTEXT_FN_W + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +InitializeSecurityContextW( + __in_opt PCredHandle phCredential, + __in_opt PCtxtHandle phContext, + __in_opt PSSPI_SEC_STRING pTargetName, + __in ULONG fContextReq, + __in ULONG Reserved1, + __in ULONG TargetDataRep, + __in_opt PSecBufferDesc pInput, + __in ULONG Reserved2, + __inout_opt PCtxtHandle phNewContext, + __inout_opt PSecBufferDesc pOutput, + __out PULONG pfContextAttr, + __out_opt PTimeStamp ptsExpiry); +#define InitializeSecurityContext InitializeSecurityContextW + +typedef +SECURITY_STATUS +(SEC_ENTRY * INITIALIZE_SECURITY_CONTEXT_FN_W)( + PCredHandle, + PCtxtHandle, + PSSPI_SEC_STRING, + ULONG, + ULONG, + ULONG, + PSecBufferDesc, + ULONG, + PCtxtHandle, + PSecBufferDesc, + PULONG, + PTimeStamp); +#define INITIALIZE_SECURITY_CONTEXT_FN INITIALIZE_SECURITY_CONTEXT_FN_W + +KSECDDDECLSPEC +PSecurityFunctionTableW +SEC_ENTRY +InitSecurityInterfaceW(VOID); +#define InitSecurityInterface InitSecurityInterfaceW + +typedef +PSecurityFunctionTableW +(SEC_ENTRY * INIT_SECURITY_INTERFACE_W)(VOID); +#define INIT_SECURITY_INTERFACE INIT_SECURITY_INTERFACE_W + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +MakeSignature( + __in PCtxtHandle phContext, + __in ULONG fQOP, + __in PSecBufferDesc pMessage, + __in ULONG MessageSeqNo); + +typedef +SECURITY_STATUS +(SEC_ENTRY * MAKE_SIGNATURE_FN)( + PCtxtHandle, + ULONG, + PSecBufferDesc, + ULONG); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +QueryContextAttributesW( + __in PCtxtHandle phContext, + __in ULONG ulAttribute, + __out PVOID pBuffer); +#define QueryContextAttributes QueryContextAttributesW + +typedef +SECURITY_STATUS +(SEC_ENTRY * QUERY_CONTEXT_ATTRIBUTES_FN_W)( + PCtxtHandle, + ULONG, + PVOID); +#define QUERY_CONTEXT_ATTRIBUTES_FN QUERY_CONTEXT_ATTRIBUTES_FN_W + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +QueryCredentialsAttributesW( + __in PCredHandle phCredential, + __in ULONG ulAttribute, + __inout PVOID pBuffer); +#define QueryCredentialsAttributes QueryCredentialsAttributesW + +typedef +SECURITY_STATUS +(SEC_ENTRY * QUERY_CREDENTIALS_ATTRIBUTES_FN_W)( + PCredHandle, + ULONG, + PVOID); +#define QUERY_CREDENTIALS_ATTRIBUTES_FN QUERY_CREDENTIALS_ATTRIBUTES_FN_W + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +QuerySecurityContextToken( + __in PCtxtHandle phContext, + __out PVOID * Token); + +typedef +SECURITY_STATUS +(SEC_ENTRY * QUERY_SECURITY_CONTEXT_TOKEN_FN)( + PCtxtHandle, PVOID *); + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +QuerySecurityPackageInfoW( + __in PSSPI_SEC_STRING pPackageName, + __deref_out PSecPkgInfoW *ppPackageInfo); +#define QuerySecurityPackageInfo QuerySecurityPackageInfoW + +typedef +SECURITY_STATUS +(SEC_ENTRY * QUERY_SECURITY_PACKAGE_INFO_FN_W)( + PSSPI_SEC_STRING, + PSecPkgInfoW *); +#define QUERY_SECURITY_PACKAGE_INFO_FN QUERY_SECURITY_PACKAGE_INFO_FN_W + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +RevertSecurityContext( + __in PCtxtHandle phContext); + +typedef +SECURITY_STATUS +(SEC_ENTRY * REVERT_SECURITY_CONTEXT_FN)( + PCtxtHandle); + +#if (OSVER(NTDDI_VERSION) > NTDDI_WIN2K) +SECURITY_STATUS +SEC_ENTRY +SetContextAttributesW( + __in PCtxtHandle phContext, + __in ULONG ulAttribute, + __in_bcount(cbBuffer) PVOID pBuffer, + __in ULONG cbBuffer); +#define SetContextAttributes SetContextAttributesW + +typedef +SECURITY_STATUS +(SEC_ENTRY * SET_CONTEXT_ATTRIBUTES_FN_W)( + PCtxtHandle, + ULONG, + PVOID, + ULONG); +#define SET_CONTEXT_ATTRIBUTES_FN SET_CONTEXT_ATTRIBUTES_FN_W +#endif + +#if (NTDDI_VERSION > NTDDI_WS03) +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +SetCredentialsAttributesW( + __in PCredHandle phCredential, + __in ULONG ulAttribute, + __in_bcount(cbBuffer) PVOID pBuffer, + __in ULONG cbBuffer); +#define SetCredentialsAttributes SetCredentialsAttributesW + +typedef +SECURITY_STATUS +(SEC_ENTRY * SET_CREDENTIALS_ATTRIBUTES_FN_W)( + PCredHandle, + ULONG, + PVOID, + ULONG); +#define SET_CREDENTIALS_ATTRIBUTES_FN SET_CREDENTIALS_ATTRIBUTES_FN_W +#endif /* NTDDI_VERSION > NTDDI_WS03 */ + +KSECDDDECLSPEC +SECURITY_STATUS +SEC_ENTRY +VerifySignature( + __in PCtxtHandle phContext, + __in PSecBufferDesc pMessage, + __in ULONG MessageSeqNo, + __out PULONG pfQOP); + +typedef +SECURITY_STATUS +(SEC_ENTRY * VERIFY_SIGNATURE_FN)( + PCtxtHandle, + PSecBufferDesc, + ULONG, + PULONG); + + +#if (ISSP_MODE == 0) + +KSECDDDECLSPEC +NTSTATUS +NTAPI +SecMakeSPN( + __in PUNICODE_STRING ServiceClass, + __in PUNICODE_STRING ServiceName, + __in_opt PUNICODE_STRING InstanceName, + __in_opt USHORT InstancePort, + __in_opt PUNICODE_STRING Referrer, + __inout PUNICODE_STRING Spn, + __out_opt PULONG Length, + __in BOOLEAN Allocate); + +#if (NTDDI_VERSION >= NTDDI_WINXP) +KSECDDDECLSPEC +NTSTATUS +NTAPI +SecMakeSPNEx( + __in PUNICODE_STRING ServiceClass, + __in PUNICODE_STRING ServiceName, + __in_opt PUNICODE_STRING InstanceName, + __in_opt USHORT InstancePort, + __in_opt PUNICODE_STRING Referrer, + __in_opt PUNICODE_STRING TargetInfo, + __inout PUNICODE_STRING Spn, + __out PULONG Length OPTIONAL, + __in BOOLEAN Allocate); + +KSECDDDECLSPEC +NTSTATUS +SEC_ENTRY +SecLookupAccountSid( + __in PSID Sid, + __out PULONG NameSize, + __inout PUNICODE_STRING NameBuffer, + __out PULONG DomainSize OPTIONAL, + __out_opt PUNICODE_STRING DomainBuffer, + __out PSID_NAME_USE NameUse + ); + +KSECDDDECLSPEC +NTSTATUS +SEC_ENTRY +SecLookupAccountName( + __in PUNICODE_STRING Name, + __inout PULONG SidSize, + __out PSID Sid, + __out PSID_NAME_USE NameUse, + __out_opt PULONG DomainSize, // WDK says __out only + ... OPTIONAL + __inout_opt PUNICODE_STRING ReferencedDomain); +#endif + +#if (NTDDI_VERSION >= NTDDI_WS03) +KSECDDDECLSPEC +NTSTATUS +SEC_ENTRY +SecLookupWellKnownSid( + __in WELL_KNOWN_SID_TYPE SidType, + __out PSID Sid, + __in ULONG SidBufferSize, + __inout_opt PULONG SidSize); +#endif + +#if (NTDDI_VERSION >= NTDDI_VISTA) +KSECDDDECLSPEC +NTSTATUS +NTAPI +SecMakeSPNEx2( + __in PUNICODE_STRING ServiceClass, + __in PUNICODE_STRING ServiceName, + __in_opt PUNICODE_STRING InstanceName, + __in_opt USHORT InstancePort, + __in_opt PUNICODE_STRING Referrer, + __in_opt PUNICODE_STRING InTargetInfo, + __inout PUNICODE_STRING Spn, + __out_opt PULONG TotalSize, + __in BOOLEAN Allocate, + __in BOOLEAN IsTargetInfoMarshaled); +#endif + +#endif /* ISSP_MODE == 0 */ + +#if (NTDDI_VERSION >= NTDDI_WIN7) + +SECURITY_STATUS +SEC_ENTRY +SspiEncodeAuthIdentityAsStrings( + __in PSEC_WINNT_AUTH_IDENTITY_OPAQUE pAuthIdentity, + __deref_out_opt PCWSTR* ppszUserName, + __deref_out_opt PCWSTR* ppszDomainName, + __deref_opt_out_opt PCWSTR* ppszPackedCredentialsString); + +SECURITY_STATUS +SEC_ENTRY +SspiValidateAuthIdentity( + __in PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData); + +SECURITY_STATUS +SEC_ENTRY +SspiCopyAuthIdentity( + __in PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData, + __deref_out PSEC_WINNT_AUTH_IDENTITY_OPAQUE* AuthDataCopy); + +VOID +SEC_ENTRY +SspiFreeAuthIdentity( + __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData); + +VOID +SEC_ENTRY +SspiZeroAuthIdentity( + __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData); + +VOID +SEC_ENTRY +SspiLocalFree( + __in_opt PVOID DataBuffer); + +SECURITY_STATUS +SEC_ENTRY +SspiEncodeStringsAsAuthIdentity( + __in_opt PCWSTR pszUserName, + __in_opt PCWSTR pszDomainName, + __in_opt PCWSTR pszPackedCredentialsString, + __deref_out PSEC_WINNT_AUTH_IDENTITY_OPAQUE* ppAuthIdentity); + +SECURITY_STATUS +SEC_ENTRY +SspiCompareAuthIdentities( + __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity1, + __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity2, + __out_opt PBOOLEAN SameSuppliedUser, + __out_opt PBOOLEAN SameSuppliedIdentity); + +SECURITY_STATUS +SEC_ENTRY +SspiMarshalAuthIdentity( + __in PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity, + __out PULONG AuthIdentityLength, + __deref_out_bcount(*AuthIdentityLength) PCHAR* AuthIdentityByteArray); + +SECURITY_STATUS +SEC_ENTRY +SspiUnmarshalAuthIdentity( + __in PULONG AuthIdentityLength, + __in_bcount(AuthIdentityLength) PCHAR AuthIdentityByteArray, + __deref_out PSEC_WINNT_AUTH_IDENTITY_OPAQUE* ppAuthIdentity); + +BOOLEAN +SEC_ENTRY +SspiIsPromptingNeeded( + __in PULONG ErrorOrNtStatus); + +SECURITY_STATUS +SEC_ENTRY +SspiGetTargetHostName( + __in PCWSTR pszTargetName, + __deref_out PWSTR* pszHostName); + +SECURITY_STATUS +SEC_ENTRY +SspiExcludePackage( + __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity, + __in PCWSTR pszPackageName, + __deref_out PSEC_WINNT_AUTH_IDENTITY_OPAQUE* ppNewAuthIdentity); + +#define SEC_WINNT_AUTH_IDENTITY_MARSHALLED 0x04 +#define SEC_WINNT_AUTH_IDENTITY_ONLY 0x08 + +#endif /* NTDDI_VERSION >= NTDDI_WIN7 */ + +#define FreeCredentialHandle FreeCredentialsHandle +struct _SECURITY_FUNCTION_TABLE_W +{ + ULONG dwVersion; + ENUMERATE_SECURITY_PACKAGES_FN_W EnumerateSecurityPackagesW; + QUERY_CREDENTIALS_ATTRIBUTES_FN_W QueryCredentialsAttributesW; + ACQUIRE_CREDENTIALS_HANDLE_FN_W AcquireCredentialsHandleW; + FREE_CREDENTIALS_HANDLE_FN FreeCredentialsHandle; + PVOID Reserved2; + INITIALIZE_SECURITY_CONTEXT_FN_W InitializeSecurityContextW; + ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext; + COMPLETE_AUTH_TOKEN_FN CompleteAuthToken; + DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext; + APPLY_CONTROL_TOKEN_FN ApplyControlToken; + QUERY_CONTEXT_ATTRIBUTES_FN_W QueryContextAttributesW; + IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext; + REVERT_SECURITY_CONTEXT_FN RevertSecurityContext; + MAKE_SIGNATURE_FN MakeSignature; + VERIFY_SIGNATURE_FN VerifySignature; + FREE_CONTEXT_BUFFER_FN FreeContextBuffer; + QUERY_SECURITY_PACKAGE_INFO_FN_W QuerySecurityPackageInfoW; + PVOID Reserved3; + PVOID Reserved4; + EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext; + IMPORT_SECURITY_CONTEXT_FN_W ImportSecurityContextW; + ADD_CREDENTIALS_FN_W AddCredentialsW ; + PVOID Reserved8; + QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken; + ENCRYPT_MESSAGE_FN EncryptMessage; + DECRYPT_MESSAGE_FN DecryptMessage; +#if OSVER(NTDDI_VERSION) > NTDDI_WIN2K + SET_CONTEXT_ATTRIBUTES_FN_W SetContextAttributesW; +#endif +#if NTDDI_VERSION > NTDDI_WS03SP1 + SET_CREDENTIALS_ATTRIBUTES_FN_W SetCredentialsAttributesW; +#endif +#if ISSP_MODE != 0 + CHANGE_PASSWORD_FN_W ChangeAccountPasswordW; +#else + PVOID Reserved9; +#endif +}; + +#endif /* !__SSPI_H__ */ Propchange: trunk/reactos/include/xdk/sspi.h ------------------------------------------------------------------------------ svn:eol-style = native
12 years, 11 months
1
0
0
0
[tkreuzer] 54824: [PSDK] - Add sal.h and include it in specstrings.h - Inlude specstrigs.h from crtdfs.h
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Jan 3 19:41:18 2012 New Revision: 54824 URL:
http://svn.reactos.org/svn/reactos?rev=54824&view=rev
Log: [PSDK] - Add sal.h and include it in specstrings.h - Inlude specstrigs.h from crtdfs.h Added: trunk/reactos/include/psdk/sal.h (with props) Modified: trunk/reactos/include/crt/crtdefs.h trunk/reactos/include/psdk/specstrings.h Modified: trunk/reactos/include/crt/crtdefs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/crtdefs.h?rev=…
============================================================================== --- trunk/reactos/include/crt/crtdefs.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/crtdefs.h [iso-8859-1] Tue Jan 3 19:41:18 2012 @@ -4,6 +4,7 @@ * No warranty is given; refer to the file DISCLAIMER within this package. */ #include <_mingw.h> +#include <specstrings.h> #ifndef _INC_CRTDEFS #define _INC_CRTDEFS Added: trunk/reactos/include/psdk/sal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/sal.h?rev=548…
============================================================================== --- trunk/reactos/include/psdk/sal.h (added) +++ trunk/reactos/include/psdk/sal.h [iso-8859-1] Tue Jan 3 19:41:18 2012 @@ -1,0 +1,332 @@ +/* + * sal.h + * + * Standard Annotation Language (SAL) definitions + * + * This file is part of the ReactOS PSDK package. + * + * Contributors: + * Timo Kreuzer (timo.kreuzer(a)reactos.org) + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +#pragma once +#define __specstrings + +#ifdef __cplusplus +#ifndef __nothrow +#define __nothrow __declspec(nothrow) +#endif +#else +#ifndef __nothrow +#define __nothrow +#endif +#endif + + +#if defined(_PREFAST_) && !defined(__midl) + +#define SPECSTRINGIZE(x) #x +#define __null __declspec("SAL_null") +#define __notnull __declspec("SAL_notnull") +#define __maybenull __declspec("SAL_maybenull") +#define __readonly __declspec("SAL_readonly") +#define __notreadonly __declspec("SAL_notreadonly") +#define __maybereadonly __declspec("SAL_maybereadonly") +#define __valid __declspec("SAL_valid") +#define __notvalid __declspec("SAL_notvalid") +#define __maybevalid __declspec("SAL_maybevalid") +#define __readableTo(extent) __declspec("SAL_readableTo("SPECSTRINGIZE(extent)")") +#define __elem_readableTo(size) __declspec("SAL_readableTo(elementCount("SPECSTRINGIZE(size)"))") +#define __byte_readableTo(size) __declspec("SAL_readableTo(byteCount("SPECSTRINGIZE(size)"))") +#define __writableTo(size) __declspec("SAL_writableTo("SPECSTRINGIZE(size)")") +#define __elem_writableTo(size) __declspec("SAL_writableTo(elementCount("SPECSTRINGIZE(size)"))") +#define __byte_writableTo(size) __declspec("SAL_writableTo(byteCount("SPECSTRINGIZE(size)"))") +#define __deref __declspec("SAL_deref") +#define __pre __declspec("SAL_pre") +#define __post __declspec("SAL_post") +#define __precond(expr) __pre +#define __postcond(expr) __post +#define __exceptthat __declspec("SAL_except") +#define __execeptthat __exceptthat +#define __refparam __deref __notreadonly +#define __inner_control_entrypoint(category) __declspec("SAL_entrypoint(controlEntry, "SPECSTRINGIZE(category)")") +#define __inner_data_entrypoint(category) __declspec("SAL_entrypoint(dataEntry, "SPECSTRINGIZE(category)")") +#define __inner_success(expr) __declspec("SAL_success("SPECSTRINGIZE(expr)")") +#define __inner_checkReturn __declspec("SAL_checkReturn") +#define __inner_typefix(ctype) __declspec("SAL_typefix("SPECSTRINGIZE(ctype)")") +#define __inner_override __declspec("__override") +#define __inner_callback __declspec("__callback") +#define __inner_blocksOn(resource) __declspec("SAL_blocksOn("SPECSTRINGIZE(resource)")") +#define __inner_fallthrough_dec __inline __nothrow void __FallThrough() {} +#define __inner_fallthrough __FallThrough(); + +#else + +#define __null +#define __notnull +#define __maybenull +#define __readonly +#define __notreadonly +#define __maybereadonly +#define __valid +#define __notvalid +#define __maybevalid +#define __readableTo(extent) +#define __elem_readableTo(size) +#define __byte_readableTo(size) +#define __writableTo(size) +#define __elem_writableTo(size) +#define __byte_writableTo(size) +#define __deref +#define __pre +#define __post +#define __precond(expr) +#define __postcond(expr) +#define __exceptthat +#define __execeptthat +#define __inner_success(expr) +#define __inner_checkReturn +#define __inner_typefix(ctype) +#define __inner_override +#define __inner_callback +#define __inner_blocksOn(resource) +#define __inner_fallthrough_dec +#define __inner_fallthrough +#define __refparam +#define __inner_control_entrypoint(category) +#define __inner_data_entrypoint(category) + +#endif /* defined(_PREFAST_) && !defined(__midl) */ + +#define __bcount(size) __notnull __byte_writableTo(size) +#define __bcount_opt(size) __bcount(size) __exceptthat __maybenull + +#define __ecount(size) __notnull __elem_writableTo(size) +#define __ecount_opt(size) __ecount(size) __exceptthat __maybenull + +#define __in __pre __valid __pre __deref __readonly +#define __in_ecount(size) __in __pre __elem_readableTo(size) +#define __in_bcount(size) __in __pre __byte_readableTo(size) +#define __in_z __in __pre __nullterminated +#define __in_ecount_z(size) __in_ecount(size) __pre __nullterminated +#define __in_bcount_z(size) __in_bcount(size) __pre __nullterminated +#define __in_nz __in +#define __in_ecount_nz(size) __in_ecount(size) +#define __in_bcount_nz(size) __in_bcount(size) +#define __in_opt __in __exceptthat __maybenull +#define __in_ecount_opt(size) __in_ecount(size) __exceptthat __maybenull +#define __in_bcount_opt(size) __in_bcount(size) __exceptthat __maybenull +#define __in_z_opt __in_opt __pre __nullterminated +#define __in_ecount_z_opt(size) __in_ecount_opt(size) __pre __nullterminated +#define __in_bcount_z_opt(size) __in_bcount_opt(size) __pre __nullterminated +#define __in_nz_opt __in_opt +#define __in_ecount_nz_opt(size) __in_ecount_opt(size) +#define __in_bcount_nz_opt(size) __in_bcount_opt(size) + +#define __inout __pre __valid __post __valid __refparam +#define __inout_ecount(size) __out_ecount(size) __pre __valid +#define __inout_bcount(size) __out_bcount(size) __pre __valid +#define __inout_ecount_part(size,length) __out_ecount_part(size,length) __pre __valid __pre __elem_readableTo(length) +#define __inout_bcount_part(size,length) __out_bcount_part(size,length) __pre __valid __pre __byte_readableTo(length) +#define __inout_ecount_full(size) __inout_ecount_part(size,size) +#define __inout_bcount_full(size) __inout_bcount_part(size,size) +#define __inout_z __inout __pre __nullterminated __post __nullterminated +#define __inout_ecount_z(size) __inout_ecount(size) __pre __nullterminated __post __nullterminated +#define __inout_bcount_z(size) __inout_bcount(size) __pre __nullterminated __post __nullterminated +#define __inout_nz __inout +#define __inout_ecount_nz(size) __inout_ecount(size) +#define __inout_bcount_nz(size) __inout_bcount(size) +#define __inout_opt __inout __exceptthat __maybenull +#define __inout_ecount_opt(size) __inout_ecount(size) __exceptthat __maybenull +#define __inout_bcount_opt(size) __inout_bcount(size) __exceptthat __maybenull +#define __inout_ecount_part_opt(size,length) __inout_ecount_part(size,length) __exceptthat __maybenull +#define __inout_bcount_part_opt(size,length) __inout_bcount_part(size,length) __exceptthat __maybenull +#define __inout_ecount_full_opt(size) __inout_ecount_full(size) __exceptthat __maybenull +#define __inout_bcount_full_opt(size) __inout_bcount_full(size) __exceptthat __maybenull +#define __inout_z_opt __inout_opt __pre __nullterminated __post __nullterminated +#define __inout_ecount_z_opt(size) __inout_ecount_opt(size) __pre __nullterminated __post __nullterminated +#define __inout_bcount_z_opt(size) __inout_bcount_opt(size) +#define __inout_nz_opt __inout_opt +#define __inout_ecount_nz_opt(size) __inout_ecount_opt(size) +#define __inout_bcount_nz_opt(size) __inout_bcount_opt(size) + +#define __out __ecount(1) __post __valid __refparam +#define __out_ecount(size) __ecount(size) __post __valid __refparam +#define __out_bcount(size) __bcount(size) __post __valid __refparam +#define __out_ecount_part(size,length) __out_ecount(size) __post __elem_readableTo(length) +#define __out_bcount_part(size,length) __out_bcount(size) __post __byte_readableTo(length) +#define __out_ecount_full(size) __out_ecount_part(size,size) +#define __out_bcount_full(size) __out_bcount_part(size,size) +#define __out_z __post __valid __refparam __post __nullterminated +#define __out_z_opt __post __valid __refparam __post __nullterminated __exceptthat __maybenull +#define __out_ecount_z(size) __ecount(size) __post __valid __refparam __post __nullterminated +#define __out_bcount_z(size) __bcount(size) __post __valid __refparam __post __nullterminated +#define __out_ecount_part_z(size,length) __out_ecount_part(size,length) __post __nullterminated +#define __out_bcount_part_z(size,length) __out_bcount_part(size,length) __post __nullterminated +#define __out_ecount_full_z(size) __out_ecount_full(size) __post __nullterminated +#define __out_bcount_full_z(size) __out_bcount_full(size) __post __nullterminated +#define __out_nz __post __valid __refparam __post +#define __out_nz_opt __post __valid __refparam __post __exceptthat __maybenull +#define __out_ecount_nz(size) __ecount(size) __post __valid __refparam +#define __out_bcount_nz(size) __bcount(size) __post __valid __refparam +#define __out_opt __out __exceptthat __maybenull +#define __out_ecount_opt(size) __out_ecount(size) __exceptthat __maybenull +#define __out_bcount_opt(size) __out_bcount(size) __exceptthat __maybenull +#define __out_ecount_part_opt(size,length) __out_ecount_part(size,length) __exceptthat __maybenull +#define __out_bcount_part_opt(size,length) __out_bcount_part(size,length) __exceptthat __maybenull +#define __out_ecount_full_opt(size) __out_ecount_full(size) __exceptthat __maybenull +#define __out_bcount_full_opt(size) __out_bcount_full(size) __exceptthat __maybenull +#define __out_ecount_z_opt(size) __out_ecount_opt(size) __post __nullterminated +#define __out_bcount_z_opt(size) __out_bcount_opt(size) __post __nullterminated +#define __out_ecount_part_z_opt(size,length) __out_ecount_part_opt(size,length) __post __nullterminated +#define __out_bcount_part_z_opt(size,length) __out_bcount_part_opt(size,length) __post __nullterminated +#define __out_ecount_full_z_opt(size) __out_ecount_full_opt(size) __post __nullterminated +#define __out_bcount_full_z_opt(size) __out_bcount_full_opt(size) __post __nullterminated +#define __out_ecount_nz_opt(size) __out_ecount_opt(size) __post __nullterminated +#define __out_bcount_nz_opt(size) __out_bcount_opt(size) __post __nullterminated + +#define __deref_ecount(size) __ecount(1) __post __elem_readableTo(1) __post __deref __notnull __post __deref __elem_writableTo(size) +#define __deref_bcount(size) __ecount(1) __post __elem_readableTo(1) __post __deref __notnull __post __deref __byte_writableTo(size) +#define __deref_out __deref_ecount(1) __post __deref __valid __refparam +#define __deref_out_ecount(size) __deref_ecount(size) __post __deref __valid __refparam +#define __deref_out_bcount(size) __deref_bcount(size) __post __deref __valid __refparam +#define __deref_out_ecount_part(size,length) __deref_out_ecount(size) __post __deref __elem_readableTo(length) +#define __deref_out_bcount_part(size,length) __deref_out_bcount(size) __post __deref __byte_readableTo(length) +#define __deref_out_ecount_full(size) __deref_out_ecount_part(size,size) +#define __deref_out_bcount_full(size) __deref_out_bcount_part(size,size) +#define __deref_out_z __post __deref __valid __refparam __post __deref __nullterminated +#define __deref_out_ecount_z(size) __deref_out_ecount(size) __post __deref __nullterminated +#define __deref_out_bcount_z(size) __deref_out_ecount(size) __post __deref __nullterminated +#define __deref_out_nz __deref_out +#define __deref_out_ecount_nz(size) __deref_out_ecount(size) +#define __deref_out_bcount_nz(size) __deref_out_ecount(size) +#define __deref_inout __notnull __elem_readableTo(1) __pre __deref __valid __post __deref __valid __refparam +#define __deref_inout_z __deref_inout __pre __deref __nullterminated __post __deref __nullterminated +#define __deref_inout_ecount(size) __deref_inout __pre __deref __elem_writableTo(size) __post __deref __elem_writableTo(size) +#define __deref_inout_bcount(size) __deref_inout __pre __deref __byte_writableTo(size) __post __deref __byte_writableTo(size) +#define __deref_inout_ecount_part(size,length) __deref_inout_ecount(size) __pre __deref __elem_readableTo(length) __post __deref __elem_readableTo(length) +#define __deref_inout_bcount_part(size,length) __deref_inout_bcount(size) __pre __deref __byte_readableTo(length) __post __deref __byte_readableTo(length) +#define __deref_inout_ecount_full(size) __deref_inout_ecount_part(size,size) +#define __deref_inout_bcount_full(size) __deref_inout_bcount_part(size,size) +#define __deref_inout_ecount_z(size) __deref_inout_ecount(size) __pre __deref __nullterminated __post __deref __nullterminated +#define __deref_inout_bcount_z(size) __deref_inout_bcount(size) __pre __deref __nullterminated __post __deref __nullterminated +#define __deref_inout_nz __deref_inout +#define __deref_inout_ecount_nz(size) __deref_inout_ecount(size) +#define __deref_inout_bcount_nz(size) __deref_inout_ecount(size) +#define __deref_ecount_opt(size) __deref_ecount(size) __post __deref __exceptthat __maybenull +#define __deref_bcount_opt(size) __deref_bcount(size) __post __deref __exceptthat __maybenull +#define __deref_out_opt __deref_out __post __deref __exceptthat __maybenull +#define __deref_out_ecount_opt(size) __deref_out_ecount(size) __post __deref __exceptthat __maybenull +#define __deref_out_bcount_opt(size) __deref_out_bcount(size) __post __deref __exceptthat __maybenull +#define __deref_out_ecount_part_opt(size,length) __deref_out_ecount_part(size,length) __post __deref __exceptthat __maybenull +#define __deref_out_bcount_part_opt(size,length) __deref_out_bcount_part(size,length) __post __deref __exceptthat __maybenull +#define __deref_out_ecount_full_opt(size) __deref_out_ecount_full(size) __post __deref __exceptthat __maybenull +#define __deref_out_bcount_full_opt(size) __deref_out_bcount_full(size) __post __deref __exceptthat __maybenull +#define __deref_out_z_opt __post __deref __valid __refparam __execeptthat __maybenull __post __deref __nullterminated +#define __deref_out_ecount_z_opt(size) __deref_out_ecount_opt(size) __post __deref __nullterminated +#define __deref_out_bcount_z_opt(size) __deref_out_bcount_opt(size) __post __deref __nullterminated +#define __deref_out_nz_opt __deref_out_opt +#define __deref_out_ecount_nz_opt(size) __deref_out_ecount_opt(size) +#define __deref_out_bcount_nz_opt(size) __deref_out_bcount_opt(size) +#define __deref_inout_opt __deref_inout __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull +#define __deref_inout_ecount_opt(size) __deref_inout_ecount(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull +#define __deref_inout_bcount_opt(size) __deref_inout_bcount(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull +#define __deref_inout_ecount_part_opt(size,length) __deref_inout_ecount_part(size,length) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull +#define __deref_inout_bcount_part_opt(size,length) __deref_inout_bcount_part(size,length) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull +#define __deref_inout_ecount_full_opt(size) __deref_inout_ecount_full(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull +#define __deref_inout_bcount_full_opt(size) __deref_inout_bcount_full(size) __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull +#define __deref_inout_z_opt __deref_inout_opt __pre __deref __nullterminated __post __deref __nullterminated +#define __deref_inout_ecount_z_opt(size) __deref_inout_ecount_opt(size) __pre __deref __nullterminated __post __deref __nullterminated +#define __deref_inout_bcount_z_opt(size) __deref_inout_bcount_opt(size) __pre __deref __nullterminated __post __deref __nullterminated +#define __deref_inout_nz_opt __deref_inout_opt +#define __deref_inout_ecount_nz_opt(size) __deref_inout_ecount_opt(size) +#define __deref_inout_bcount_nz_opt(size) __deref_inout_bcount_opt(size) + +#define __deref_opt_ecount(size) __deref_ecount(size) __exceptthat __maybenull +#define __deref_opt_bcount(size) __deref_bcount(size) __exceptthat __maybenull +#define __deref_opt_out __deref_out __exceptthat __maybenull +#define __deref_opt_out_z __deref_opt_out __post __deref __nullterminated +#define __deref_opt_out_ecount(size) __deref_out_ecount(size) __exceptthat __maybenull +#define __deref_opt_out_bcount(size) __deref_out_bcount(size) __exceptthat __maybenull +#define __deref_opt_out_ecount_part(size,length) __deref_out_ecount_part(size,length) __exceptthat __maybenull +#define __deref_opt_out_bcount_part(size,length) __deref_out_bcount_part(size,length) __exceptthat __maybenull +#define __deref_opt_out_ecount_full(size) __deref_out_ecount_full(size) __exceptthat __maybenull +#define __deref_opt_out_bcount_full(size) __deref_out_bcount_full(size) __exceptthat __maybenull +#define __deref_opt_inout __deref_inout __exceptthat __maybenull +#define __deref_opt_inout_ecount(size) __deref_inout_ecount(size) __exceptthat __maybenull +#define __deref_opt_inout_bcount(size) __deref_inout_bcount(size) __exceptthat __maybenull +#define __deref_opt_inout_ecount_part(size,length) __deref_inout_ecount_part(size,length) __exceptthat __maybenull +#define __deref_opt_inout_bcount_part(size,length) __deref_inout_bcount_part(size,length) __exceptthat __maybenull +#define __deref_opt_inout_ecount_full(size) __deref_inout_ecount_full(size) __exceptthat __maybenull +#define __deref_opt_inout_bcount_full(size) __deref_inout_bcount_full(size) __exceptthat __maybenull +#define __deref_opt_inout_z __deref_opt_inout __pre __deref __nullterminated __post __deref __nullterminated +#define __deref_opt_inout_ecount_z(size) __deref_opt_inout_ecount(size) __pre __deref __nullterminated __post __deref __nullterminated +#define __deref_opt_inout_bcount_z(size) __deref_opt_inout_bcount(size) __pre __deref __nullterminated __post __deref __nullterminated +#define __deref_opt_inout_nz __deref_opt_inout +#define __deref_opt_inout_ecount_nz(size) __deref_opt_inout_ecount(size) +#define __deref_opt_inout_bcount_nz(size) __deref_opt_inout_bcount(size) +#define __deref_opt_ecount_opt(size) __deref_ecount_opt(size) __exceptthat __maybenull +#define __deref_opt_bcount_opt(size) __deref_bcount_opt(size) __exceptthat __maybenull +#define __deref_opt_out_opt __deref_out_opt __exceptthat __maybenull +#define __deref_opt_out_ecount_opt(size) __deref_out_ecount_opt(size) __exceptthat __maybenull +#define __deref_opt_out_bcount_opt(size) __deref_out_bcount_opt(size) __exceptthat __maybenull +#define __deref_opt_out_ecount_part_opt(size,length) __deref_out_ecount_part_opt(size,length) __exceptthat __maybenull +#define __deref_opt_out_bcount_part_opt(size,length) __deref_out_bcount_part_opt(size,length) __exceptthat __maybenull +#define __deref_opt_out_ecount_full_opt(size) __deref_out_ecount_full_opt(size) __exceptthat __maybenull +#define __deref_opt_out_bcount_full_opt(size) __deref_out_bcount_full_opt(size) __exceptthat __maybenull +#define __deref_opt_out_z_opt __post __deref __valid __refparam __exceptthat __maybenull __pre __deref __exceptthat __maybenull __post __deref __exceptthat __maybenull __post __deref __nullterminated +#define __deref_opt_out_ecount_z_opt(size) __deref_opt_out_ecount_opt(size) __post __deref __nullterminated +#define __deref_opt_out_bcount_z_opt(size) __deref_opt_out_bcount_opt(size) __post __deref __nullterminated +#define __deref_opt_out_nz_opt __deref_opt_out_opt +#define __deref_opt_out_ecount_nz_opt(size) __deref_opt_out_ecount_opt(size) +#define __deref_opt_out_bcount_nz_opt(size) __deref_opt_out_bcount_opt(size) +#define __deref_opt_inout_opt __deref_inout_opt __exceptthat __maybenull +#define __deref_opt_inout_ecount_opt(size) __deref_inout_ecount_opt(size) __exceptthat __maybenull +#define __deref_opt_inout_bcount_opt(size) __deref_inout_bcount_opt(size) __exceptthat __maybenull +#define __deref_opt_inout_ecount_part_opt(size,length) __deref_inout_ecount_part_opt(size,length) __exceptthat __maybenull +#define __deref_opt_inout_bcount_part_opt(size,length) __deref_inout_bcount_part_opt(size,length) __exceptthat __maybenull +#define __deref_opt_inout_ecount_full_opt(size) __deref_inout_ecount_full_opt(size) __exceptthat __maybenull +#define __deref_opt_inout_bcount_full_opt(size) __deref_inout_bcount_full_opt(size) __exceptthat __maybenull +#define __deref_opt_inout_z_opt __deref_opt_inout_opt __pre __deref __nullterminated __post __deref __nullterminated +#define __deref_opt_inout_ecount_z_opt(size) __deref_opt_inout_ecount_opt(size) __pre __deref __nullterminated __post __deref __nullterminated +#define __deref_opt_inout_bcount_z_opt(size) __deref_opt_inout_bcount_opt(size) __pre __deref __nullterminated __post __deref __nullterminated +#define __deref_opt_inout_nz_opt __deref_opt_inout_opt +#define __deref_opt_inout_ecount_nz_opt(size) __deref_opt_inout_ecount_opt(size) +#define __deref_opt_inout_bcount_nz_opt(size) __deref_opt_inout_bcount_opt(size) + +#define __success(expr) __inner_success(expr) +#define __nullterminated __readableTo(sentinel(0)) +#define __nullnullterminated +#define __reserved __pre __null +#define __checkReturn __inner_checkReturn +#define __typefix(ctype) __inner_typefix(ctype) +#define __override __inner_override +#define __callback __inner_callback +#define __format_string +#define __blocksOn(resource) __inner_blocksOn(resource) +#define __control_entrypoint(category) __inner_control_entrypoint(category) +#define __data_entrypoint(category) __inner_data_entrypoint(category) + +#ifndef __fallthrough +__inner_fallthrough_dec +#define __fallthrough __inner_fallthrough +#endif + +#ifndef __analysis_assume +#ifdef _PREFAST_ +#define __analysis_assume(expr) __assume(expr) +#else +#define __analysis_assume(expr) +#endif +#endif Propchange: trunk/reactos/include/psdk/sal.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/include/psdk/specstrings.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/specstrings.h…
============================================================================== --- trunk/reactos/include/psdk/specstrings.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/specstrings.h [iso-8859-1] Tue Jan 3 19:41:18 2012 @@ -3,17 +3,14 @@ * This file is part of the w64 mingw-runtime package. * No warranty is given; refer to the file DISCLAIMER.PD within this package. */ -#define __specstrings +#pragma once +#define SPECSTRINGS_H -#ifdef __cplusplus -#ifndef __nothrow -#define __nothrow __declspec(nothrow) -#endif -#else -#ifndef __nothrow -#define __nothrow -#endif -#endif +#include <sal.h> + +#define __field_bcount(size) __notnull __byte_writableTo(size) +#define __field_ecount(size) __notnull __elem_writableTo(size) + #define __deref_in #define __deref_in_ecount(size) @@ -29,250 +26,8 @@ #define __deref_opt_in_bcount_opt(size) #define __out_awcount(expr,size) #define __in_awcount(expr,size) -#ifndef __cplusplus -#define __null -#endif -#define __notnull -#define __maybenull -#define __readonly -#define __notreadonly -#define __maybereadonly -#define __valid -#define __notvalid -#define __maybevalid -#define __readableTo(extent) -#define __elem_readableTo(size) -#define __byte_readableTo(size) -#define __writableTo(size) -#define __elem_writableTo(size) -#define __byte_writableTo(size) -#define __deref -#define __pre -#define __post -#define __precond(expr) -#define __postcond(expr) -#define __exceptthat -#define __execeptthat -#define __inner_success(expr) -#define __inner_checkReturn -#define __inner_typefix(ctype) -#define __inner_override -#define __inner_callback -#define __inner_blocksOn(resource) -#define __inner_fallthrough_dec -#define __inner_fallthrough -#define __refparam -#define __inner_control_entrypoint(category) -#define __inner_data_entrypoint(category) -#define __ecount(size) -#define __bcount(size) -#ifndef __cplusplus -#define __in -#endif -#define __in_opt -#define __in_nz -#define __in_nz_opt -#define __in_z -#define __in_z_opt -#define __in_ecount(size) -#define __in_ecount_nz(size) -#define __in_ecount_z(size) -#define __in_bcount(size) -#define __in_bcount_z(size) -#define __in_bcount_nz(size) -#define __in_ecount_opt(size) -#define __in_bcount_opt(size) -#define __in_ecount_z_opt(size) -#define __in_bcount_z_opt(size) -#define __in_ecount_nz_opt(size) -#define __in_bcount_nz_opt(size) -#define __out -#define __out_ecount(size) -#define __out_z -#define __out_nz -#define __out_nz_opt -#define __out_z_opt -#define __out_ecount_part(size,length) -#define __out_ecount_full(size) -#define __out_ecount_nz(size) -#define __out_ecount_z(size) -#define __out_ecount_part_z(size,length) -#define __out_ecount_full_z(size) -#define __out_bcount(size) -#define __out_bcount_part(size,length) -#define __out_bcount_full(size) -#define __out_bcount_z(size) -#define __out_bcount_part_z(size,length) -#define __out_bcount_full_z(size) -#define __out_bcount_nz(size) -#define __inout -#define __inout_ecount(size) -#define __inout_bcount(size) -#define __inout_ecount_part(size,length) -#define __inout_bcount_part(size,length) -#define __inout_ecount_full(size) -#define __inout_bcount_full(size) -#define __inout_z -#define __inout_ecount_z(size) -#define __inout_bcount_z(size) -#define __inout_nz -#define __inout_ecount_nz(size) -#define __inout_bcount_nz(size) -#define __ecount_opt(size) -#define __bcount_opt(size) -#define __out_opt -#define __out_ecount_opt(size) -#define __out_bcount_opt(size) -#define __out_ecount_part_opt(size,length) -#define __out_bcount_part_opt(size,length) -#define __out_ecount_full_opt(size) -#define __out_bcount_full_opt(size) -#define __out_ecount_z_opt(size) -#define __out_bcount_z_opt(size) -#define __out_ecount_part_z_opt(size,length) -#define __out_bcount_part_z_opt(size,length) -#define __out_ecount_full_z_opt(size) -#define __out_bcount_full_z_opt(size) -#define __out_ecount_nz_opt(size) -#define __out_bcount_nz_opt(size) -#define __inout_opt -#define __inout_ecount_opt(size) -#define __inout_bcount_opt(size) -#define __inout_ecount_part_opt(size,length) -#define __inout_bcount_part_opt(size,length) -#define __inout_ecount_full_opt(size) -#define __inout_bcount_full_opt(size) -#define __inout_z_opt -#define __inout_ecount_z_opt(size) -#define __inout_bcount_z_opt(size) -#define __inout_nz_opt -#define __inout_ecount_nz_opt(size) -#define __inout_bcount_nz_opt(size) -#define __deref_ecount(size) -#define __deref_bcount(size) -#define __deref_out -#define __deref_out_ecount(size) -#define __deref_out_bcount(size) -#define __deref_out_ecount_part(size,length) -#define __deref_out_bcount_part(size,length) -#define __deref_out_ecount_full(size) -#define __deref_out_bcount_full(size) -#define __deref_out_z -#define __deref_out_ecount_z(size) -#define __deref_out_bcount_z(size) -#define __deref_out_nz -#define __deref_out_ecount_nz(size) -#define __deref_out_bcount_nz(size) -#define __deref_inout -#define __deref_inout_ecount(size) -#define __deref_inout_bcount(size) -#define __deref_inout_ecount_part(size,length) -#define __deref_inout_bcount_part(size,length) -#define __deref_inout_ecount_full(size) -#define __deref_inout_bcount_full(size) -#define __deref_inout_z -#define __deref_inout_ecount_z(size) -#define __deref_inout_bcount_z(size) -#define __deref_inout_nz -#define __deref_inout_ecount_nz(size) -#define __deref_inout_bcount_nz(size) -#define __deref_ecount_opt(size) -#define __deref_bcount_opt(size) -#define __deref_out_opt -#define __deref_out_ecount_opt(size) -#define __deref_out_bcount_opt(size) -#define __deref_out_ecount_part_opt(size,length) -#define __deref_out_bcount_part_opt(size,length) -#define __deref_out_ecount_full_opt(size) -#define __deref_out_bcount_full_opt(size) -#define __deref_out_z_opt -#define __deref_out_ecount_z_opt(size) -#define __deref_out_bcount_z_opt(size) -#define __deref_out_nz_opt -#define __deref_out_ecount_nz_opt(size) -#define __deref_out_bcount_nz_opt(size) -#define __deref_inout_opt -#define __deref_inout_ecount_opt(size) -#define __deref_inout_bcount_opt(size) -#define __deref_inout_ecount_part_opt(size,length) -#define __deref_inout_bcount_part_opt(size,length) -#define __deref_inout_ecount_full_opt(size) -#define __deref_inout_bcount_full_opt(size) -#define __deref_inout_z_opt -#define __deref_inout_ecount_z_opt(size) -#define __deref_inout_bcount_z_opt(size) -#define __deref_inout_nz_opt -#define __deref_inout_ecount_nz_opt(size) -#define __deref_inout_bcount_nz_opt(size) -#define __deref_opt_ecount(size) -#define __deref_opt_bcount(size) -#define __deref_opt_out -#define __deref_opt_out_z -#define __deref_opt_out_ecount(size) -#define __deref_opt_out_bcount(size) -#define __deref_opt_out_ecount_part(size,length) -#define __deref_opt_out_bcount_part(size,length) -#define __deref_opt_out_ecount_full(size) -#define __deref_opt_out_bcount_full(size) -#define __deref_opt_inout -#define __deref_opt_inout_ecount(size) -#define __deref_opt_inout_bcount(size) -#define __deref_opt_inout_ecount_part(size,length) -#define __deref_opt_inout_bcount_part(size,length) -#define __deref_opt_inout_ecount_full(size) -#define __deref_opt_inout_bcount_full(size) -#define __deref_opt_inout_z -#define __deref_opt_inout_ecount_z(size) -#define __deref_opt_inout_bcount_z(size) -#define __deref_opt_inout_nz -#define __deref_opt_inout_ecount_nz(size) -#define __deref_opt_inout_bcount_nz(size) -#define __deref_opt_ecount_opt(size) -#define __deref_opt_bcount_opt(size) -#define __deref_opt_out_opt -#define __deref_opt_out_ecount_opt(size) -#define __deref_opt_out_bcount_opt(size) -#define __deref_opt_out_ecount_part_opt(size,length) -#define __deref_opt_out_bcount_part_opt(size,length) -#define __deref_opt_out_ecount_full_opt(size) -#define __deref_opt_out_bcount_full_opt(size) -#define __deref_opt_out_z_opt -#define __deref_opt_out_ecount_z_opt(size) -#define __deref_opt_out_bcount_z_opt(size) -#define __deref_opt_out_nz_opt -#define __deref_opt_out_ecount_nz_opt(size) -#define __deref_opt_out_bcount_nz_opt(size) -#define __deref_opt_inout_opt -#define __deref_opt_inout_ecount_opt(size) -#define __deref_opt_inout_bcount_opt(size) -#define __deref_opt_inout_ecount_part_opt(size,length) -#define __deref_opt_inout_bcount_part_opt(size,length) -#define __deref_opt_inout_ecount_full_opt(size) -#define __deref_opt_inout_bcount_full_opt(size) -#define __deref_opt_inout_z_opt -#define __deref_opt_inout_ecount_z_opt(size) -#define __deref_opt_inout_bcount_z_opt(size) -#define __deref_opt_inout_nz_opt -#define __deref_opt_inout_ecount_nz_opt(size) -#define __deref_opt_inout_bcount_nz_opt(size) -#define __success(expr) -#define __nullterminated #define __nullnullterminated -#define __reserved -#define __checkReturn -#define __typefix(ctype) -#define __override -#define __callback -#define __format_string -#define __blocksOn(resource) -#define __control_entrypoint(category) -#define __data_entrypoint(category) -#ifndef __fallthrough -#define __fallthrough -#endif -#ifndef __analysis_assume #define __analysis_assume(expr) -#endif //#endif
12 years, 11 months
1
0
0
0
[cgutman] 54823: [NDISUIO] - Make reads cancelable - Fix a bug in IOCTL_CANCEL_READ handling
by cgutman@svn.reactos.org
Author: cgutman Date: Tue Jan 3 19:37:03 2012 New Revision: 54823 URL:
http://svn.reactos.org/svn/reactos?rev=54823&view=rev
Log: [NDISUIO] - Make reads cancelable - Fix a bug in IOCTL_CANCEL_READ handling Modified: branches/wlan-bringup/drivers/network/ndisuio/ioctl.c branches/wlan-bringup/drivers/network/ndisuio/readwrite.c Modified: branches/wlan-bringup/drivers/network/ndisuio/ioctl.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
============================================================================== --- branches/wlan-bringup/drivers/network/ndisuio/ioctl.c [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/ndisuio/ioctl.c [iso-8859-1] Tue Jan 3 19:37:03 2012 @@ -109,7 +109,7 @@ { PacketEntry->PacketLength = 0; - ExInterlockedInsertTailList(&AdapterContext->PacketList, + ExInterlockedInsertHeadList(&AdapterContext->PacketList, &PacketEntry->ListEntry, &AdapterContext->Spinlock); Modified: branches/wlan-bringup/drivers/network/ndisuio/readwrite.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
============================================================================== --- branches/wlan-bringup/drivers/network/ndisuio/readwrite.c [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/ndisuio/readwrite.c [iso-8859-1] Tue Jan 3 19:37:03 2012 @@ -10,6 +10,30 @@ #define NDEBUG #include <debug.h> + +VOID +NTAPI +ReadIrpCancel(PDEVICE_OBJECT DeviceObject, PIRP Irp) +{ + PNDISUIO_ADAPTER_CONTEXT AdapterContext = IrpSp->FileObject->FsContext; + PNDISUIO_PACKET_ENTRY PacketEntry; + + /* Release the cancel spin lock */ + IoReleaseCancelSpinLock(Irp->CancelIrql); + + /* Indicate a 0-byte packet on the queue to cancel the read */ + PacketEntry = ExAllocatePool(PagedPool, sizeof(NDISUIO_PACKET_ENTRY)); + if (PacketEntry) + { + PacketEntry->PacketLength = 0; + + ExInterlockedInsertHeadList(&AdapterContext->PacketList, + &PacketEntry->ListEntry, + &AdapterContext->Spinlock); + + KeSetEvent(&AdapterContext->PacketReadEvent, IO_NO_INCREMENT, FALSE); + } +} NTSTATUS NTAPI @@ -19,7 +43,7 @@ PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp); PNDISUIO_ADAPTER_CONTEXT AdapterContext = IrpSp->FileObject->FsContext; PNDISUIO_OPEN_ENTRY OpenEntry = IrpSp->FileObject->FsContext2; - KIRQL OldIrql; + KIRQL OldIrql, OldCancelIrql; NTSTATUS Status; PLIST_ENTRY ListEntry; PNDISUIO_PACKET_ENTRY PacketEntry = NULL; @@ -35,6 +59,22 @@ return STATUS_INVALID_PARAMETER; } + + /* Make the read cancellable */ + IoAcquireCancelSpinLock(&OldCancelIrql); + IoSetCancelRoutine(Irp, ReadIrpCancel); + if (Irp->Cancel) + { + IoReleaseCancelSpinLock(OldCancelIrql); + + /* Indicate a 0 byte read */ + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_SUCCESS; + } + IoReleaseCancelSpinLock(OldCancelIrql); while (TRUE) { @@ -52,10 +92,22 @@ TRUE, NULL); if (Status != STATUS_SUCCESS) + { + /* Remove the cancel routine */ + IoAcquireCancelSpinLock(&OldCancelIrql); + IoSetCancelRoutine(Irp, NULL); + IoReleaseCancelSpinLock(OldCancelIrql); + break; + } } else { + /* Remove the cancel routine */ + IoAcquireCancelSpinLock(&OldCancelIrql); + IoSetCancelRoutine(Irp, NULL); + IoReleaseCancelSpinLock(OldCancelIrql); + /* Remove the first packet in the list */ ListEntry = RemoveHeadList(&AdapterContext->PacketList); PacketEntry = CONTAINING_RECORD(ListEntry, NDISUIO_PACKET_ENTRY, ListEntry);
12 years, 11 months
1
0
0
0
[cgutman] 54822: [NDISUIO] - Fix missing spin lock release - Return the correct status for an invalid index
by cgutman@svn.reactos.org
Author: cgutman Date: Tue Jan 3 19:22:30 2012 New Revision: 54822 URL:
http://svn.reactos.org/svn/reactos?rev=54822&view=rev
Log: [NDISUIO] - Fix missing spin lock release - Return the correct status for an invalid index Modified: branches/wlan-bringup/drivers/network/ndisuio/ioctl.c Modified: branches/wlan-bringup/drivers/network/ndisuio/ioctl.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
============================================================================== --- branches/wlan-bringup/drivers/network/ndisuio/ioctl.c [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/ndisuio/ioctl.c [iso-8859-1] Tue Jan 3 19:22:30 2012 @@ -52,6 +52,7 @@ i++; CurrentEntry = CurrentEntry->Flink; } + KeReleaseSpinLock(&GlobalAdapterListLock, OldIrql); if (i == QueryBinding->BindingIndex) { AdapterContext = CONTAINING_RECORD(CurrentEntry, NDISUIO_ADAPTER_CONTEXT, ListEntry); @@ -78,7 +79,7 @@ else { /* Invalid index */ - Status = STATUS_INVALID_PARAMETER; + Status = STATUS_NO_MORE_ENTRIES; } } else
12 years, 11 months
1
0
0
0
[cgutman] 54821: [NDISUIO] - Handle IOCTL_NDISUIO_BIND_WAIT and IOCTL_NDISUIO_QUERY_BINDING
by cgutman@svn.reactos.org
Author: cgutman Date: Tue Jan 3 19:11:57 2012 New Revision: 54821 URL:
http://svn.reactos.org/svn/reactos?rev=54821&view=rev
Log: [NDISUIO] - Handle IOCTL_NDISUIO_BIND_WAIT and IOCTL_NDISUIO_QUERY_BINDING Modified: branches/wlan-bringup/drivers/network/ndisuio/ioctl.c Modified: branches/wlan-bringup/drivers/network/ndisuio/ioctl.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
============================================================================== --- branches/wlan-bringup/drivers/network/ndisuio/ioctl.c [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/ndisuio/ioctl.c [iso-8859-1] Tue Jan 3 19:11:57 2012 @@ -11,6 +11,90 @@ #define NDEBUG #include <debug.h> + +NTSTATUS +WaitForBind(PIRP Irp, PIO_STACK_LOCATION IrpSp) +{ + /* I've seen several code samples that use this IOCTL but there's + * no official documentation on it. I'm just implementing it as a no-op + * right now because I don't see any reason we need it. We handle an open + * and bind just fine with IRP_MJ_CREATE and IOCTL_NDISUIO_OPEN_DEVICE */ + + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_SUCCESS; +} + +NTSTATUS +QueryBinding(PIRP Irp, PIO_STACK_LOCATION IrpSp) +{ + PNDISUIO_ADAPTER_CONTEXT AdapterContext; + PNDISUIO_QUERY_BINDING QueryBinding = IrpSp->Parameters.DeviceIoControl.Type3InputBuffer; + ULONG BindingLength = IrpSp->Parameters.DeviceIoControl.InputBufferLength; + NTSTATUS Status; + PLIST_ENTRY CurrentEntry; + KIRQL OldIrql; + ULONG i; + ULONG BytesCopied = 0; + + if (QueryBinding && BindingLength >= sizeof(NDISUIO_QUERY_BINDING)) + { + KeAcquireSpinLock(&GlobalAdapterListLock, &OldIrql); + i = 0; + CurrentEntry = GlobalAdapterList.Flink; + while (CurrentEntry != &GlobalAdapterList) + { + if (i == QueryBinding->BindingIndex) + break; + i++; + CurrentEntry = CurrentEntry->Flink; + } + if (i == QueryBinding->BindingIndex) + { + AdapterContext = CONTAINING_RECORD(CurrentEntry, NDISUIO_ADAPTER_CONTEXT, ListEntry); + if (AdapterContext->DeviceName.Length <= QueryBinding->DeviceNameLength) + { + BytesCopied += AdapterContext->DeviceName.Length; + RtlCopyMemory((PUCHAR)QueryBinding + QueryBinding->DeviceNameOffset, + AdapterContext->DeviceName.Buffer, + BytesCopied); + QueryBinding->DeviceNameLength = AdapterContext->DeviceName.Length; + + /* FIXME: Copy description too */ + QueryBinding->DeviceDescrLength = 0; + + /* Successful */ + Status = STATUS_SUCCESS; + } + else + { + /* Not enough buffer space */ + Status = STATUS_BUFFER_TOO_SMALL; + } + } + else + { + /* Invalid index */ + Status = STATUS_INVALID_PARAMETER; + } + } + else + { + /* Invalid parameters */ + Status = STATUS_INVALID_PARAMETER; + } + + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = BytesCopied; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return Status; +} + NTSTATUS CancelPacketRead(PIRP Irp, PIO_STACK_LOCATION IrpSp) { @@ -338,6 +422,12 @@ case IOCTL_NDISUIO_OPEN_WRITE_DEVICE: return OpenDeviceWrite(Irp, IrpSp); + + case IOCTL_NDISUIO_BIND_WAIT: + return WaitForBind(Irp, IrpSp); + + case IOCTL_NDISUIO_QUERY_BINDING: + return QueryBinding(Irp, IrpSp); default: /* Fail if this file object has no adapter associated */
12 years, 11 months
1
0
0
0
[pschweitzer] 54820: [RTL] Complete RtlpDosPathNameToRelativeNtPathName_Ustr() rewrite by properly handling relative names. This fixes several regressions brought by r54804 (see winetests). This al...
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Tue Jan 3 19:08:46 2012 New Revision: 54820 URL:
http://svn.reactos.org/svn/reactos?rev=54820&view=rev
Log: [RTL] Complete RtlpDosPathNameToRelativeNtPathName_Ustr() rewrite by properly handling relative names. This fixes several regressions brought by r54804 (see winetests). This also fixes file system corruption when using directory functions. This may also fix general file system corruption, so, please retest bug #6720. Modified: trunk/reactos/lib/rtl/path.c Modified: trunk/reactos/lib/rtl/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/path.c?rev=54820&r…
============================================================================== --- trunk/reactos/lib/rtl/path.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/path.c [iso-8859-1] Tue Jan 3 19:08:46 2012 @@ -39,6 +39,8 @@ const UNICODE_STRING RtlpDosCONDevice = RTL_CONSTANT_STRING(L"CON"); const UNICODE_STRING RtlpDosNULDevice = RTL_CONSTANT_STRING(L"NUL"); +PRTLP_CURDIR_REF RtlpCurDirRef; + /* PRIVATE FUNCTIONS **********************************************************/ ULONG @@ -455,11 +457,12 @@ WCHAR BigBuffer[MAX_PATH + 1]; PWCHAR PrefixBuffer, NewBuffer, Buffer; ULONG MaxLength, PathLength, PrefixLength, PrefixCut, LengthChars, Length; - UNICODE_STRING CapturedDosName, PartNameString; + UNICODE_STRING CapturedDosName, PartNameString, FullPath; BOOLEAN QuickPath; RTL_PATH_TYPE InputPathType, BufferPathType; NTSTATUS Status; BOOLEAN NameInvalid; + PCURDIR CurrentDirectory; /* Assume MAX_PATH for now */ DPRINT("Relative: %lx DosName: %wZ NtName: %wZ, PartName: %p, RelativeName: %p\n", @@ -608,26 +611,59 @@ /* Setup the structure */ RtlInitEmptyUnicodeString(&RelativeName->RelativeName, NULL, 0); RelativeName->ContainingDirectory = NULL; - RelativeName->CurDirRef = 0; + RelativeName->CurDirRef = NULL; /* Check if the input path itself was relative */ if (InputPathType == RtlPathTypeRelative) { - /* FIXME: HACK: Old code */ - PCURDIR cd; - UNICODE_STRING us; - cd = (PCURDIR)&(NtCurrentPeb ()->ProcessParameters->CurrentDirectory.DosPath); - if (cd->Handle) - { - RtlInitUnicodeString(&us, Buffer); - us.Length = (cd->DosPath.Length < us.Length) ? cd->DosPath.Length : us.Length; - if (RtlEqualUnicodeString(&us, &cd->DosPath, TRUE)) + /* Get current directory */ + CurrentDirectory = (PCURDIR)&(NtCurrentPeb ()->ProcessParameters->CurrentDirectory.DosPath); + if (CurrentDirectory->Handle) + { + Status = RtlInitUnicodeStringEx(&FullPath, Buffer); + if (!NT_SUCCESS(Status)) { - Length = ((cd->DosPath.Length / sizeof(WCHAR)) - PrefixCut) + ((InputPathType == 1) ? 8 : 4); - RelativeName->RelativeName.Buffer = NewBuffer + Length; - RelativeName->RelativeName.Length = NtName->Length - (USHORT)(Length * sizeof(WCHAR)); + RtlFreeHeap(RtlGetProcessHeap(), 0, NewBuffer); + RtlReleasePebLock(); + return Status; + } + + /* If current directory is bigger than full path, there's no way */ + if (CurrentDirectory->DosPath.Length > FullPath.Length) + { + RtlReleasePebLock(); + return Status; + } + + /* File is in current directory */ + if (RtlEqualUnicodeString(&FullPath, &CurrentDirectory->DosPath, TRUE)) + { + /* Make relative name string */ + RelativeName->RelativeName.Buffer = (PWSTR)((ULONG_PTR)NewBuffer + FullPath.Length - PrefixCut); + RelativeName->RelativeName.Length = PathLength - FullPath.Length; + /* If relative name starts with \, skip it */ + if (RelativeName->RelativeName.Buffer[0] == L'\\') + { + RelativeName->RelativeName.Buffer = (PWSTR)((ULONG_PTR)RelativeName->RelativeName.Buffer + sizeof(WCHAR)); + RelativeName->RelativeName.Length -= sizeof(WCHAR); + } RelativeName->RelativeName.MaximumLength = RelativeName->RelativeName.Length; - RelativeName->ContainingDirectory = cd->Handle; + DPRINT("RelativeName: %wZ\n", &(RelativeName->RelativeName)); + + if (!HaveRelative) + { + RelativeName->ContainingDirectory = CurrentDirectory->Handle; + return Status; + } + + /* Give back current directory data & reference counter */ + RelativeName->CurDirRef = RtlpCurDirRef; + if (RelativeName->CurDirRef) + { + /* FIXME: Increment reference count */ + } + + RelativeName->ContainingDirectory = CurrentDirectory->Handle; } } }
12 years, 11 months
1
0
0
0
[cgutman] 54819: [NDISUIO] - Handle IOCTL_NDISUIO_OPEN_WRITE_DEVICE and IOCTL_NDISUIO_OPEN_DEVICE properly with regard to current open handles - Check that we have read permissions (opened by IOCTL...
by cgutman@svn.reactos.org
Author: cgutman Date: Tue Jan 3 18:12:29 2012 New Revision: 54819 URL:
http://svn.reactos.org/svn/reactos?rev=54819&view=rev
Log: [NDISUIO] - Handle IOCTL_NDISUIO_OPEN_WRITE_DEVICE and IOCTL_NDISUIO_OPEN_DEVICE properly with regard to current open handles - Check that we have read permissions (opened by IOCTL_NDISUIO_OPEN_DEVICE) before allowing queries or reads Modified: branches/wlan-bringup/drivers/network/ndisuio/ioctl.c branches/wlan-bringup/drivers/network/ndisuio/ndisuio.h branches/wlan-bringup/drivers/network/ndisuio/readwrite.c Modified: branches/wlan-bringup/drivers/network/ndisuio/ioctl.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
============================================================================== --- branches/wlan-bringup/drivers/network/ndisuio/ioctl.c [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/ndisuio/ioctl.c [iso-8859-1] Tue Jan 3 18:12:29 2012 @@ -174,8 +174,19 @@ { /* Reference the adapter context */ KeAcquireSpinLock(&AdapterContext->Spinlock, &OldIrql); - ReferenceAdapterContext(AdapterContext); - Status = STATUS_SUCCESS; + if (AdapterContext->OpenCount != 0) + { + /* An open for read-write is exclusive, + * so we can't have any other open handles */ + KeReleaseSpinLock(&AdapterContext->Spinlock, OldIrql); + Status = STATUS_INVALID_PARAMETER; + } + else + { + /* Add a reference */ + ReferenceAdapterContext(AdapterContext); + Status = STATUS_SUCCESS; + } } else { @@ -191,6 +202,9 @@ { /* Set the file object pointer */ OpenEntry->FileObject = FileObject; + + /* Set the permissions */ + OpenEntry->WriteOnly = FALSE; /* Associate this FO with the adapter */ FileObject->FsContext = AdapterContext; @@ -230,8 +244,80 @@ NTSTATUS OpenDeviceWrite(PIRP Irp, PIO_STACK_LOCATION IrpSp) { - /* FIXME: Handle this correctly */ - return OpenDeviceReadWrite(Irp, IrpSp); + PFILE_OBJECT FileObject = IrpSp->FileObject; + UNICODE_STRING DeviceName; + ULONG NameLength; + NTSTATUS Status; + PNDISUIO_ADAPTER_CONTEXT AdapterContext; + PNDISUIO_OPEN_ENTRY OpenEntry; + KIRQL OldIrql; + + NameLength = IrpSp->Parameters.DeviceIoControl.InputBufferLength; + if (NameLength != 0) + { + DeviceName.MaximumLength = DeviceName.Length = NameLength; + DeviceName.Buffer = IrpSp->Parameters.DeviceIoControl.Type3InputBuffer; + + /* Check if this already has a context */ + AdapterContext = FindAdapterContextByName(&DeviceName); + if (AdapterContext != NULL) + { + /* Reference the adapter context */ + KeAcquireSpinLock(&AdapterContext->Spinlock, &OldIrql); + ReferenceAdapterContext(AdapterContext); + Status = STATUS_SUCCESS; + } + else + { + /* Invalid device name */ + Status = STATUS_INVALID_PARAMETER; + } + + /* Check that the bind succeeded */ + if (NT_SUCCESS(Status)) + { + OpenEntry = ExAllocatePool(NonPagedPool, sizeof(*OpenEntry)); + if (OpenEntry) + { + /* Set the file object pointer */ + OpenEntry->FileObject = FileObject; + + /* Associate this FO with the adapter */ + FileObject->FsContext = AdapterContext; + FileObject->FsContext2 = OpenEntry; + + /* Set permissions */ + OpenEntry->WriteOnly = TRUE; + + /* Add it to the adapter's list */ + InsertTailList(&AdapterContext->OpenEntryList, + &OpenEntry->ListEntry); + + /* Success */ + KeReleaseSpinLock(&AdapterContext->Spinlock, OldIrql); + Status = STATUS_SUCCESS; + } + else + { + /* Remove the reference we added */ + KeReleaseSpinLock(&AdapterContext->Spinlock, OldIrql); + DereferenceAdapterContext(AdapterContext, NULL); + Status = STATUS_NO_MEMORY; + } + } + } + else + { + /* Invalid device name */ + Status = STATUS_INVALID_PARAMETER; + } + + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return Status; } NTSTATUS @@ -240,6 +326,7 @@ PIRP Irp) { PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp); + PNDISUIO_OPEN_ENTRY OpenEntry; ASSERT(DeviceObject == GlobalDeviceObject); @@ -263,24 +350,39 @@ return STATUS_INVALID_PARAMETER; } - /* Now handle other IOCTLs */ + /* Now handle write IOCTLs */ switch (IrpSp->Parameters.DeviceIoControl.IoControlCode) { - case IOCTL_CANCEL_READ: - return CancelPacketRead(Irp, IrpSp); - - case IOCTL_NDISUIO_QUERY_OID_VALUE: - return QueryAdapterOid(Irp, IrpSp); - case IOCTL_NDISUIO_SET_OID_VALUE: return SetAdapterOid(Irp, IrpSp); default: - DPRINT1("Unimplemented\n"); - Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - break; + /* Check that we have read permissions */ + OpenEntry = IrpSp->FileObject->FsContext2; + if (OpenEntry->WriteOnly) + { + Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_INVALID_PARAMETER; + } + + switch (IrpSp->Parameters.DeviceIoControl.IoControlCode) + { + case IOCTL_CANCEL_READ: + return CancelPacketRead(Irp, IrpSp); + + case IOCTL_NDISUIO_QUERY_OID_VALUE: + return QueryAdapterOid(Irp, IrpSp); + + default: + DPRINT1("Unimplemented\n"); + Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + break; + } } break; } Modified: branches/wlan-bringup/drivers/network/ndisuio/ndisuio.h URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
============================================================================== --- branches/wlan-bringup/drivers/network/ndisuio/ndisuio.h [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/ndisuio/ndisuio.h [iso-8859-1] Tue Jan 3 18:12:29 2012 @@ -42,9 +42,24 @@ /* File object */ PFILE_OBJECT FileObject; + /* Tracks how this adapter was opened (write-only or read-write) */ + BOOLEAN WriteOnly; + /* List entry */ LIST_ENTRY ListEntry; } NDISUIO_OPEN_ENTRY, *PNDISUIO_OPEN_ENTRY; + +struct _NDISUIO_PACKET_ENTRY +{ + /* Length of data at the end of the struct */ + ULONG PacketLength; + + /* Entry on the packet list */ + LIST_ENTRY ListEntry; + + /* Packet data */ + UCHAR PacketData[1]; +} NDISUIO_PACKET_ENTRY, *PNDISUIO_PACKET_ENTRY; /* NDIS version info */ #define NDIS_MAJOR_VERISON 5 Modified: branches/wlan-bringup/drivers/network/ndisuio/readwrite.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
============================================================================== --- branches/wlan-bringup/drivers/network/ndisuio/readwrite.c [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/ndisuio/readwrite.c [iso-8859-1] Tue Jan 3 18:12:29 2012 @@ -18,6 +18,7 @@ { PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp); PNDISUIO_ADAPTER_CONTEXT AdapterContext = IrpSp->FileObject->FsContext; + PNDISUIO_OPEN_ENTRY OpenEntry = IrpSp->FileObject->FsContext2; KIRQL OldIrql; NTSTATUS Status; PLIST_ENTRY ListEntry; @@ -25,6 +26,15 @@ ULONG BytesCopied = 0; ASSERT(DeviceObject == GlobalDeviceObject); + + if (OpenEntry->WriteOnly) + { + Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_INVALID_PARAMETER; + } while (TRUE) {
12 years, 11 months
1
0
0
0
[cgutman] 54818: [NDISUIO] - Implement IOCTL_CANCEL_READ - Implement IRP_MJ_READ and IRP_MJ_WRITE handling - Misc fixes
by cgutman@svn.reactos.org
Author: cgutman Date: Tue Jan 3 17:54:01 2012 New Revision: 54818 URL:
http://svn.reactos.org/svn/reactos?rev=54818&view=rev
Log: [NDISUIO] - Implement IOCTL_CANCEL_READ - Implement IRP_MJ_READ and IRP_MJ_WRITE handling - Misc fixes Modified: branches/wlan-bringup/drivers/network/ndisuio/ioctl.c branches/wlan-bringup/drivers/network/ndisuio/misc.c branches/wlan-bringup/drivers/network/ndisuio/ndisuio.h branches/wlan-bringup/drivers/network/ndisuio/protocol.c branches/wlan-bringup/drivers/network/ndisuio/readwrite.c Modified: branches/wlan-bringup/drivers/network/ndisuio/ioctl.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
============================================================================== --- branches/wlan-bringup/drivers/network/ndisuio/ioctl.c [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/ndisuio/ioctl.c [iso-8859-1] Tue Jan 3 17:54:01 2012 @@ -12,6 +12,40 @@ #include <debug.h> NTSTATUS +CancelPacketRead(PIRP Irp, PIO_STACK_LOCATION IrpSp) +{ + PNDISUIO_ADAPTER_CONTEXT AdapterContext = IrpSp->FileObject->FsContext; + PNDISUIO_PACKET_ENTRY PacketEntry; + NTSTATUS Status; + + /* Indicate a 0-byte packet on the queue so one read returns 0 */ + PacketEntry = ExAllocatePool(PagedPool, sizeof(NDISUIO_PACKET_ENTRY)); + if (PacketEntry) + { + PacketEntry->PacketLength = 0; + + ExInterlockedInsertTailList(&AdapterContext->PacketList, + &PacketEntry->ListEntry, + &AdapterContext->Spinlock); + + KeSetEvent(&AdapterContext->PacketReadEvent, IO_NO_INCREMENT, FALSE); + + Status = STATUS_SUCCESS; + } + else + { + Status = STATUS_NO_MEMORY; + } + + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return Status; +} + +NTSTATUS SetAdapterOid(PIRP Irp, PIO_STACK_LOCATION IrpSp) { PNDISUIO_ADAPTER_CONTEXT AdapterContext = IrpSp->FileObject->FsContext; @@ -232,6 +266,9 @@ /* Now handle other IOCTLs */ switch (IrpSp->Parameters.DeviceIoControl.IoControlCode) { + case IOCTL_CANCEL_READ: + return CancelPacketRead(Irp, IrpSp); + case IOCTL_NDISUIO_QUERY_OID_VALUE: return QueryAdapterOid(Irp, IrpSp); Modified: branches/wlan-bringup/drivers/network/ndisuio/misc.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
============================================================================== --- branches/wlan-bringup/drivers/network/ndisuio/misc.c [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/ndisuio/misc.c [iso-8859-1] Tue Jan 3 17:54:01 2012 @@ -10,6 +10,98 @@ #define NDEBUG #include <debug.h> + +NDIS_STATUS +AllocateAndChainBuffer(PNDIS_PACKET Packet, PVOID Buffer, ULONG BufferSize, BOOLEAN Front) +{ + NDIS_STATUS Status; + + /* Allocate the NDIS buffer mapping the pool */ + NdisAllocateBuffer(&Status, + &Buffer, + GlobalBufferPoolHandle, + Buffer, + Length); + if (Status != NDIS_STATUS_SUCCESS) + { + DPRINT1("No free buffer descriptors\n"); + return Status; + } + + if (Front) + { + /* Chain the buffer to front */ + NdisChainBufferAtFront(Packet, Buffer); + } + else + { + /* Chain the buffer to back */ + NdisChainBufferAtBack(Packet, Buffer); + } + + /* Return success */ + return NDIS_STATUS_SUCCESS; +} + +PNDIS_PACKET +CreatePacketFromPoolBuffer(PVOID Buffer, ULONG BufferSize) +{ + PNDIS_PACKET Packet; + NDIS_STATUS Status; + + /* Allocate a packet descriptor */ + NdisAllocatePacket(&Status, + &Packet, + GlobalPacketPoolHandle); + if (Status != NDIS_STATUS_SUCCESS) + { + DPRINT1("No free packet descriptors\n"); + return NULL; + } + + /* Use the helper to chain the buffer */ + Status = AllocateAndChainBuffer(Packet, Buffer, BufferSize, TRUE); + if (Status != NDIS_STATUS_SUCCESS) + { + NdisFreePacket(Packet); + return NULL; + } + + /* Return the packet */ + return Packet; +} + +VOID +CleanupAndFreePacket(PNDIS_PACKET Packet, BOOLEAN FreePool) +{ + PNDIS_BUFFER Buffer; + PVOID Data; + ULONG Length; + + /* Free each buffer and its backing pool memory */ + while (TRUE) + { + /* Unchain each buffer */ + NdisUnchainBufferAtFront(Packet, &Buffer); + if (!Buffer) + break; + + /* Get the backing memory */ + NdisQueryBuffer(Buffer, &Data, &Length); + + /* Free the buffer */ + NdisFreeBuffer(Buffer); + + if (FreePool) + { + /* Free the backing memory */ + ExFreePool(Data); + } + } + + /* Free the packet descriptor */ + NdisFreePacket(Packet); +} PNDISUIO_ADAPTER_CONTEXT FindAdapterContextByName(PNDIS_STRING DeviceName) @@ -70,19 +162,7 @@ /* Free the open entry */ ExFreePool(OpenEntry); } - - /* See if this binding can be destroyed */ - if (AdapterContext->OpenCount == 0) - { - /* Unlock the context */ - KeReleaseSpinLock(&AdapterContext->Spinlock, OldIrql); - /* Destroy the adapter context */ - UnbindAdapterByContext(AdapterContext); - } - else - { - /* Still more references on it */ - KeReleaseSpinLock(&AdapterContext->Spinlock, OldIrql); - } + /* Release the adapter context lock */ + KeReleaseSpinLock(&AdapterContext->Spinlock, OldIrql); } Modified: branches/wlan-bringup/drivers/network/ndisuio/ndisuio.h URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
============================================================================== --- branches/wlan-bringup/drivers/network/ndisuio/ndisuio.h [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/ndisuio/ndisuio.h [iso-8859-1] Tue Jan 3 17:54:01 2012 @@ -28,9 +28,7 @@ /* Receive packet list */ LIST_ENTRY PacketList; - - /* Cancel read */ - BOOLEAN CancelRead; + KEVENT PacketReadEvent; /* Global list entry */ LIST_ENTRY ListEntry; Modified: branches/wlan-bringup/drivers/network/ndisuio/protocol.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
============================================================================== --- branches/wlan-bringup/drivers/network/ndisuio/protocol.c [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/ndisuio/protocol.c [iso-8859-1] Tue Jan 3 17:54:01 2012 @@ -48,7 +48,13 @@ PNDIS_PACKET Packet, NDIS_STATUS Status) { - /* FIXME: Implement send/receive */ + PNDISUIO_ADAPTER_CONTEXT AdapterContext = ProtocolBindingContext; + + DPRINT("Asynchronous adapter send completed\n"); + + /* Store the final status and signal the event */ + AdapterContext->AsyncStatus = Status; + KeSetEvent(&AdapterContext->AsyncEvent, IO_NO_INCREMENT, FALSE); } VOID @@ -58,7 +64,13 @@ NDIS_STATUS Status, UINT BytesTransferred) { - /* FIXME: Implement send/receive */ + PNDISUIO_ADAPTER_CONTEXT AdapterContext = ProtocolBindingContext; + + DPRINT("Asynchronous adapter transfer completed\n"); + + /* Store the final status and signal the event */ + AdapterContext->AsyncStatus = Status; + KeSetEvent(&AdapterContext->AsyncEvent, IO_NO_INCREMENT, FALSE); } VOID @@ -100,8 +112,82 @@ UINT LookaheadBufferSize, UINT PacketSize) { - /* FIXME: Implement send/receive */ - return NDIS_STATUS_NOT_ACCEPTED; + PNDISUIO_ADAPTER_CONTEXT AdapterContext = ProtocolBindingContext; + PVOID PacketBuffer; + PNDIS_PACKET Packet; + NDIS_STATUS Status; + ULONG BytesTransferred; + + /* Allocate a buffer to hold the packet data and header */ + PacketBuffer = ExAllocatePool(NonPagedPool, PacketSize); + if (!PacketBuffer) + return NDIS_STATUS_NOT_ACCEPTED; + + /* Allocate the packet descriptor and buffer */ + Packet = CreatePacketFromPoolBuffer((PUCHAR)PacketBuffer + HeaderBufferSize, + PacketSize); + if (!Packet) + { + ExFreePool(PacketBuffer); + return NDIS_STATUS_NOT_ACCEPTED; + } + + /* Transfer the packet data into our data buffer */ + NdisTransferData(&Status, + AdapterContext->BindingHandle, + MacReceiveContext, + 0, + PacketSize, + &BytesTransferred); + if (Status == NDIS_STATUS_PENDING) + { + KeWaitForSingleObject(&AdapterContext->AsyncEvent, + Executive, + KernelMode, + FALSE, + NULL); + Status = AdapterContext->AsyncStatus; + } + if (Status != NDIS_STATUS_SUCCESS) + { + DPRINT1("Failed to transfer data with status 0x%x\n", Status); + CleanupAndFreePacket(Packet, TRUE); + return NDIS_STATUS_NOT_ACCEPTED; + } + + /* Copy the header data */ + RtlCopyMemory(PacketBuffer, HeaderBuffer, HeaderBufferSize); + + /* Free the packet descriptor and buffers + but not the pool because we still need it */ + CleanupAndFreePacket(Packet, FALSE); + + /* Allocate a packet entry from paged pool */ + PacketEntry = ExAllocatePool(PagedPool, sizeof(NDISUIO_PACKET_ENTRY) + BytesTransferred + HeaderBufferSize - 1); + if (!PacketEntry) + { + ExFreePool(PacketBuffer); + return NDIS_STATUS_RESOURCES; + } + + /* Initialize the packet entry and copy in packet data */ + PacketEntry->PacketLength = BytesTransferred + HeaderBufferSize; + RtlCopyMemory(&PacketEntry->PacketData[0], PacketBuffer, PacketEntry->PacketLength); + + /* Free the old non-paged buffer */ + ExFreePool(PacketBuffer); + + /* Insert the packet on the adapter's packet list */ + ExInterlockedInsertTailList(&AdapterContext->PacketList, + &PacketEntry->ListEntry, + &AdapterContext->Spinlock); + + /* Signal the read event */ + KeSetEvent(&AdapterContext->PacketReadEvent, + IO_NETWORK_INCREMENT, + FALSE); + + return NDIS_STATUS_SUCCESS; } VOID @@ -134,7 +220,7 @@ KIRQL OldIrql; PLIST_ENTRY CurrentOpenEntry; PNDISUIO_OPEN_ENTRY OpenEntry; - + /* Remove the adapter context from the global list */ KeAcquireSpinLock(&GlobalAdapterListLock, &OldIrql); RemoveEntryList(&AdapterContext->ListEntry); @@ -167,7 +253,7 @@ /* If this fails, we have a refcount mismatch somewhere */ ASSERT(AdapterContext->OpenCount == 0); - + /* Send the close request */ NdisCloseAdapter(Status, AdapterContext->BindingHandle); @@ -206,6 +292,7 @@ /* Set up the adapter context */ RtlZeroMemory(AdapterContext, sizeof(*AdapterContext)); KeInitializeEvent(&AdapterContext->AsyncEvent, SynchronizationEvent, FALSE); + KeInitializeEvent(&AdapterContext->PacketReadEvent, SynchronizationEvent, FALSE); KeInitializeSpinLock(&AdapterContext->Spinlock); InitializeListHead(&AdapterContext->PacketList); InitializeListHead(&AdapterContext->OpenEntryList); Modified: branches/wlan-bringup/drivers/network/ndisuio/readwrite.c URL:
http://svn.reactos.org/svn/reactos/branches/wlan-bringup/drivers/network/nd…
============================================================================== --- branches/wlan-bringup/drivers/network/ndisuio/readwrite.c [iso-8859-1] (original) +++ branches/wlan-bringup/drivers/network/ndisuio/readwrite.c [iso-8859-1] Tue Jan 3 17:54:01 2012 @@ -11,34 +11,134 @@ #define NDEBUG #include <debug.h> -VOID +NTSTATUS NTAPI NduDispatchRead(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp); + PNDISUIO_ADAPTER_CONTEXT AdapterContext = IrpSp->FileObject->FsContext; + KIRQL OldIrql; + NTSTATUS Status; + PLIST_ENTRY ListEntry; + PNDISUIO_PACKET_ENTRY PacketEntry = NULL; + ULONG BytesCopied = 0; + ASSERT(DeviceObject == GlobalDeviceObject); - /* FIXME: Not implemented */ - Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; - Irp->IoStatus.Information = 0; + while (TRUE) + { + KeAcquireSpinLock(&AdapterContext->Spinlock, &OldIrql); - IoCompleteRequest(Irp, IO_NO_INCREMENT); + /* Check if we have a packet */ + if (IsListEmpty(&AdapterContext->PacketList)) + { + KeReleaseSpinLock(&AdapterContext->Spinlock, OldIrql); - return STATUS_NOT_IMPLEMENTED; + /* Wait for a packet (in the context of the calling user thread) */ + Status = KeWaitForSingleObject(&AdapterContext->PacketReadEvent, + UserRequest, + UserMode, + TRUE, + NULL); + if (Status != STATUS_SUCCESS) + break; + } + else + { + /* Remove the first packet in the list */ + ListEntry = RemoveHeadList(&AdapterContext->PacketList); + PacketEntry = CONTAINING_RECORD(ListEntry, NDISUIO_PACKET_ENTRY, ListEntry); + + /* Release the adapter lock */ + KeReleaseSpinLock(&AdapterContext->Spinlock, OldIrql); + + /* And we're done with this loop */ + Status = STATUS_SUCCESS; + break; + } + } + + /* Check if we got a packet */ + if (PacketEntry != NULL) + { + /* Find the right amount of bytes to copy */ + BytesCopied = PacketEntry->PacketLength; + if (BytesCopied > IrpSp->Parameters.Read.Length) + BytesCopied = IrpSp->Parameters.Read.Length; + + /* Copy the packet */ + RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer, + &PacketEntry->PacketBuffer[0], + BytesCopied); + + /* Free the packet entry */ + ExFreePool(PacketEntry); + } + else + { + /* Something failed */ + BytesCopied = 0; + } + + /* Complete the IRP */ + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = BytesCopied; + IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + + return Status; } -VOID +NTSTATUS NTAPI NduDispatchWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp); + PNDISUIO_ADAPTER_CONTEXT AdapterContext = IrpSp->FileObject->FsContext; + PNDIS_PACKET Packet; + NDIS_STATUS Status; + ULONG BytesCopied = 0; + ASSERT(DeviceObject == GlobalDeviceObject); + + /* Create a packet and buffer descriptor for this user buffer */ + Packet = CreatePacketFromPoolBuffer(Irp->AssociatedIrp.SystemBuffer, + IrpSp->Parameters.Write.Length); + if (Packet) + { + /* Send it via NDIS */ + NdisSend(&Status, + AdapterContext->BindingHandle, + Packet); - /* FIXME: Not implemented */ - Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; - Irp->IoStatus.Information = 0; + /* Wait for the send */ + if (Status == NDIS_STATUS_PENDING) + { + KeWaitForSingleObject(&AdapterContext->AsyncEvent, + Executive, + KernelMode, + FALSE, + NULL); + Status = AdapterContext->AsyncStatus; + } - IoCompleteRequest(Irp, IO_NO_INCREMENT); + /* Check if it succeeded */ + if (Status == NDIS_STATUS_SUCCESS) + BytesCopied = IrpSp->Parameters.Write.Length; - return STATUS_NOT_IMPLEMENTED; + CleanupAndFreePacket(Packet); + } + else + { + /* No memory */ + Status = STATUS_NO_MEMORY; + } + + /* Complete the IRP */ + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = BytesCopied; + IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); + + return Status; }
12 years, 11 months
1
0
0
0
← Newer
1
...
51
52
53
54
55
56
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Results per page:
10
25
50
100
200