diff --git a/contrib/win32/win32compat/lsa_missingdefs.h b/contrib/win32/win32compat/lsa_missingdefs.h index 838c1b316..87472fcfd 100644 --- a/contrib/win32/win32compat/lsa_missingdefs.h +++ b/contrib/win32/win32compat/lsa_missingdefs.h @@ -53,8 +53,3 @@ NTSTATUS WINAPI LsaManageSidNameMapping( PLSA_SID_NAME_MAPPING_OPERATION_INPUT OpInput, PLSA_SID_NAME_MAPPING_OPERATION_OUTPUT *OpOutput ); - -VOID WINAPI RtlInitUnicodeString( - PUNICODE_STRING DestinationString, - PCWSTR SourceString -); \ No newline at end of file diff --git a/contrib/win32/win32compat/win32_usertoken_utils.c b/contrib/win32/win32compat/win32_usertoken_utils.c index e455088f3..82b16f9d8 100644 --- a/contrib/win32/win32compat/win32_usertoken_utils.c +++ b/contrib/win32/win32compat/win32_usertoken_utils.c @@ -443,8 +443,9 @@ AddSidMappingToLsa(PUNICODE_STRING domain_name, error("LsaManageSidNameMapping failed with ntstatus: %d \n", status); } - if (p_output) - LsaFreeMemory(p_output); + /* TODO - Free p_output */ + /*if (p_output) + LsaFreeMemory(p_output);*/ return ret; } @@ -469,12 +470,21 @@ int RemoveVirtualAccountLSAMapping(PUNICODE_STRING domain_name, if (status != STATUS_SUCCESS) ret = -1; - if (p_output) - LsaFreeMemory(p_output); + /* TODO - Free p_output */ + /*if (p_output) + LsaFreeMemory(p_output);*/ return ret; } +void +InitUnicodeString(PUNICODE_STRING dest, PCWSTR source) +{ + dest->Buffer = source; + dest->Length = wcslen(source) * sizeof(wchar_t); + dest->MaximumLength = dest->Length + 2; +} + HANDLE generate_sshd_virtual_token() { SID_IDENTIFIER_AUTHORITY nt_authority = SECURITY_NT_AUTHORITY; @@ -486,9 +496,9 @@ HANDLE generate_sshd_virtual_token() StringCchPrintfW(va_name, 32, L"%s_%d", L"sshd", GetCurrentProcessId()); - RtlInitUnicodeString(&domain, VIRTUALUSER_DOMAIN); - RtlInitUnicodeString(&group, VIRTUALUSER_GROUP_NAME); - RtlInitUnicodeString(&account, va_name); + InitUnicodeString(&domain, VIRTUALUSER_DOMAIN); + InitUnicodeString(&group, VIRTUALUSER_GROUP_NAME); + InitUnicodeString(&account, va_name); /* Initialize SIDs */ /* domain SID - S-1-5-111 */