From 1451db2450728504042ffdaca36c30e0a2002a5e Mon Sep 17 00:00:00 2001 From: manojampalam Date: Thu, 12 May 2016 19:33:43 -0700 Subject: [PATCH] 5-12 C4 --- contrib/win32/win32compat/lsa/LsaString.cpp | 10 +--- contrib/win32/win32compat/lsa/LsaString.h | 23 +++----- contrib/win32/win32compat/lsa/Ssh-lsa.cpp | 6 --- contrib/win32/win32compat/lsa/Ssh-lsa.h | 60 +++++---------------- 4 files changed, 19 insertions(+), 80 deletions(-) diff --git a/contrib/win32/win32compat/lsa/LsaString.cpp b/contrib/win32/win32compat/lsa/LsaString.cpp index 65fc04c..0f88f41 100644 --- a/contrib/win32/win32compat/lsa/LsaString.cpp +++ b/contrib/win32/win32compat/lsa/LsaString.cpp @@ -29,15 +29,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef __VS_BUILD__ -#define UMDF_USING_NTSTATUS - -#include -#include -#include -#endif - -#include "LsaString.h" +#include "ssh-lsa.h" #ifdef __VS_BUILD__ #ifdef __cplusplus diff --git a/contrib/win32/win32compat/lsa/LsaString.h b/contrib/win32/win32compat/lsa/LsaString.h index 001a28d..4a842c3 100644 --- a/contrib/win32/win32compat/lsa/LsaString.h +++ b/contrib/win32/win32compat/lsa/LsaString.h @@ -34,28 +34,17 @@ #undef STRING - - -#include "Win64Fix.h" - -#include -#include - #include +#define SECURITY_WIN32 +#include #include #include - -#ifndef __VS_BUILD__ -#ifdef _WIN64 #include -#else -#include -#endif -#else -#include -#endif +#include "Types.h" -#include "Debug.h" +#define FAIL(CONDITION) if(CONDITION) goto fail + +#define NTFAIL(NTFUNC) if((ntStat = (NTFUNC))) goto fail NTSTATUS LsaAllocUnicodeString(UNICODE_STRING **lsaStr, DWORD maxLen); diff --git a/contrib/win32/win32compat/lsa/Ssh-lsa.cpp b/contrib/win32/win32compat/lsa/Ssh-lsa.cpp index 2a6a5cb..cb2987a 100644 --- a/contrib/win32/win32compat/lsa/Ssh-lsa.cpp +++ b/contrib/win32/win32compat/lsa/Ssh-lsa.cpp @@ -31,12 +31,6 @@ #define WINVER 0x501 -#ifdef __VS_BUILD__ -#define UMDF_USING_NTSTATUS - -#include -#endif - #include "Ssh-lsa.h" #ifdef __cplusplus diff --git a/contrib/win32/win32compat/lsa/Ssh-lsa.h b/contrib/win32/win32compat/lsa/Ssh-lsa.h index b4faff1..9670fe3 100644 --- a/contrib/win32/win32compat/lsa/Ssh-lsa.h +++ b/contrib/win32/win32compat/lsa/Ssh-lsa.h @@ -34,37 +34,14 @@ #undef STRING #undef TEST_APP - -#include "Win64Fix.h" - - +#define UMDF_USING_NTSTATUS #include - +#define SECURITY_WIN32 +#include +#include #include - -#ifndef __VS_BUILD__ -#ifdef _WIN64 #include -#else -#include -#endif -#else -#include -#endif - -#include -#include -#include - -#include -#include -#include - -#include "Debug.h" -#include "KeyAuth.h" -#include "LsaString.h" -#include "SSLFix.h" -#include "DeskRight.h" +#include "Types.h" #define PKG_NAME "SSH-LSA" @@ -97,27 +74,14 @@ typedef VOID (WINAPI *RtlInitUnicodeStringPtr) (PUNICODE_STRING, PCWSTR SourceString); #endif +#define FAIL(CONDITION) if(CONDITION) goto fail -#ifndef __VS_BUILD__ -#ifndef _WIN64 -typedef struct _LSA_TOKEN_INFORMATION_V1 -{ - LARGE_INTEGER ExpirationTime; - - TOKEN_USER User; - - PTOKEN_GROUPS Groups; - - TOKEN_PRIMARY_GROUP PrimaryGroup; - - PTOKEN_PRIVILEGES Privileges; - - TOKEN_OWNER Owner; +#define NTFAIL(NTFUNC) if((ntStat = (NTFUNC))) goto fail - TOKEN_DEFAULT_DACL DefaultDacl; -} -LSA_TOKEN_INFORMATION_V1, *PLSA_TOKEN_INFORMATION_V1; -#endif -#endif +NTSTATUS LsaAllocUnicodeString(UNICODE_STRING **lsaStr, DWORD maxLen); + +NTSTATUS FillUnicodeString(UNICODE_STRING *lsaStr, const Char *str); + +void LsaFreeUnicodeString(UNICODE_STRING *lsaStr); #endif