From 0e3ec03c2d7b569a44769d7467acf79b299456d5 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Fri, 22 Dec 2023 14:24:59 -0700 Subject: [PATCH] resolving build warnings --- apps/wolfsshd/auth.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/apps/wolfsshd/auth.c b/apps/wolfsshd/auth.c index 53722ee20..fdebc7d5f 100644 --- a/apps/wolfsshd/auth.c +++ b/apps/wolfsshd/auth.c @@ -39,6 +39,9 @@ #ifndef _WIN32 #include +#else +/* avoid macro redefinition warnings on STATUS values when include ntstatus.h */ +#define UMDF_USING_NTSTATUS #endif #include @@ -685,6 +688,21 @@ static int CheckPublicKeyUnix(const char* name, #include #include + +/* Pulled in from Advapi32.dll */ +extern BOOL WINAPI LogonUserExExW(LPTSTR usr, + LPTSTR dmn, + LPTSTR paswd, + DWORD logonType, + DWORD logonProv, + PTOKEN_GROUPS tokenGrp, + PHANDLE tokenPh, + PSID* loginSid, + PVOID* pBuffer, + LPDWORD pBufferLen , + PQUOTA_LIMITS quotaLimits +); + #define MAX_USERNAME 256 static int _GetHomeDirectory(WOLFSSHD_AUTH* auth, const char* usr, WCHAR* out, int outSz) @@ -705,7 +723,7 @@ static int _GetHomeDirectory(WOLFSSHD_AUTH* auth, const char* usr, WCHAR* out, i CoTaskMemFree(homeDir); } else { - PROFILEINFO pInfo = { sizeof(PROFILEINFO) }; + PROFILEINFO pInfo = { 0 }; /* failed with get known folder path, try with loading the user profile */ pInfo.dwFlags = PI_NOUI;