Skip to content

Commit 1451db2

Browse files
committed
5-12 C4
1 parent 105f54e commit 1451db2

File tree

4 files changed

+19
-80
lines changed

4 files changed

+19
-80
lines changed

contrib/win32/win32compat/lsa/LsaString.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,7 @@
2929
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
*/
3131

32-
#ifdef __VS_BUILD__
33-
#define UMDF_USING_NTSTATUS
34-
35-
#include <Windows.h>
36-
#include <LsaLookup.h>
37-
#include <Ntsecapi.h>
38-
#endif
39-
40-
#include "LsaString.h"
32+
#include "ssh-lsa.h"
4133

4234
#ifdef __VS_BUILD__
4335
#ifdef __cplusplus

contrib/win32/win32compat/lsa/LsaString.h

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,17 @@
3434

3535
#undef STRING
3636

37-
38-
39-
#include "Win64Fix.h"
40-
41-
#include <stdio.h>
42-
#include <wchar.h>
43-
4437
#include <windows.h>
38+
#define SECURITY_WIN32
39+
#include <security.h>
4540
#include <Ntsecapi.h>
4641
#include <NTSecPkg.h>
47-
48-
#ifndef __VS_BUILD__
49-
#ifdef _WIN64
5042
#include <ntstatus.h>
51-
#else
52-
#include <ddk/ntstatus.h>
53-
#endif
54-
#else
55-
#include <ntstatus.h>
56-
#endif
43+
#include "Types.h"
44+
45+
#define FAIL(CONDITION) if(CONDITION) goto fail
5746

58-
#include "Debug.h"
47+
#define NTFAIL(NTFUNC) if((ntStat = (NTFUNC))) goto fail
5948

6049
NTSTATUS LsaAllocUnicodeString(UNICODE_STRING **lsaStr, DWORD maxLen);
6150

contrib/win32/win32compat/lsa/Ssh-lsa.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@
3131

3232
#define WINVER 0x501
3333

34-
#ifdef __VS_BUILD__
35-
#define UMDF_USING_NTSTATUS
36-
37-
#include <Windows.h>
38-
#endif
39-
4034
#include "Ssh-lsa.h"
4135

4236
#ifdef __cplusplus

contrib/win32/win32compat/lsa/Ssh-lsa.h

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -34,37 +34,14 @@
3434

3535
#undef STRING
3636
#undef TEST_APP
37-
38-
#include "Win64Fix.h"
39-
40-
37+
#define UMDF_USING_NTSTATUS
4138
#include <windows.h>
42-
39+
#define SECURITY_WIN32
40+
#include <security.h>
41+
#include <Ntsecapi.h>
4342
#include <NTSecPkg.h>
44-
45-
#ifndef __VS_BUILD__
46-
#ifdef _WIN64
4743
#include <ntstatus.h>
48-
#else
49-
#include <ddk/ntstatus.h>
50-
#endif
51-
#else
52-
#include <ntstatus.h>
53-
#endif
54-
55-
#include <Userenv.h>
56-
#include <Shlwapi.h>
57-
#include <sddl.h>
58-
59-
#include <openssl/rsa.h>
60-
#include <openssl/dsa.h>
61-
#include <openssl/ssl.h>
62-
63-
#include "Debug.h"
64-
#include "KeyAuth.h"
65-
#include "LsaString.h"
66-
#include "SSLFix.h"
67-
#include "DeskRight.h"
44+
#include "Types.h"
6845

6946
#define PKG_NAME "SSH-LSA"
7047

@@ -97,27 +74,14 @@ typedef VOID (WINAPI *RtlInitUnicodeStringPtr)
9774
(PUNICODE_STRING, PCWSTR SourceString);
9875
#endif
9976

77+
#define FAIL(CONDITION) if(CONDITION) goto fail
10078

101-
#ifndef __VS_BUILD__
102-
#ifndef _WIN64
103-
typedef struct _LSA_TOKEN_INFORMATION_V1
104-
{
105-
LARGE_INTEGER ExpirationTime;
106-
107-
TOKEN_USER User;
108-
109-
PTOKEN_GROUPS Groups;
110-
111-
TOKEN_PRIMARY_GROUP PrimaryGroup;
112-
113-
PTOKEN_PRIVILEGES Privileges;
114-
115-
TOKEN_OWNER Owner;
79+
#define NTFAIL(NTFUNC) if((ntStat = (NTFUNC))) goto fail
11680

117-
TOKEN_DEFAULT_DACL DefaultDacl;
118-
}
119-
LSA_TOKEN_INFORMATION_V1, *PLSA_TOKEN_INFORMATION_V1;
120-
#endif
121-
#endif
81+
NTSTATUS LsaAllocUnicodeString(UNICODE_STRING **lsaStr, DWORD maxLen);
82+
83+
NTSTATUS FillUnicodeString(UNICODE_STRING *lsaStr, const Char *str);
84+
85+
void LsaFreeUnicodeString(UNICODE_STRING *lsaStr);
12286

12387
#endif

0 commit comments

Comments
 (0)