Created
April 19, 2024 00:17
-
-
Save rbmm/60d0944b1bb19df5fa213edcf9732ed4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NTSTATUS BuildSupplementalCredential(_In_ MSV1_0_SUPPLEMENTAL_CREDENTIAL_V3* pmsc, | |
_Out_ PSECPKG_SUPPLEMENTAL_CRED_ARRAY* pSupplementalCredentials) | |
{ | |
union { | |
PVOID buf; | |
PSECPKG_SUPPLEMENTAL_CRED_ARRAY SupplementalCredentials; | |
PUCHAR pc; | |
PMSV1_0_SUPPLEMENTAL_CREDENTIAL_V3 pmsvsc; | |
PWSTR psz; | |
}; | |
if (buf = LSA(AllocateLsaHeap(sizeof(SECPKG_SUPPLEMENTAL_CRED_ARRAY) + | |
sizeof(MSV1_0_SUPPLEMENTAL_CREDENTIAL_V3) + sizeof(NTLMSP_NAME)))) | |
{ | |
*pSupplementalCredentials = SupplementalCredentials; | |
SupplementalCredentials->CredentialCount = 1; | |
PSECPKG_SUPPLEMENTAL_CRED Credentials = SupplementalCredentials++->Credentials; | |
Credentials->CredentialSize = sizeof(MSV1_0_SUPPLEMENTAL_CREDENTIAL_V3); | |
Credentials->Credentials = pc; | |
memcpy(pmsvsc++, pmsc, sizeof(MSV1_0_SUPPLEMENTAL_CREDENTIAL_V3)); | |
RtlInitUnicodeString(&Credentials->PackageName, wcscpy(psz, NTLMSP_NAME)); | |
return STATUS_SUCCESS; | |
} | |
return STATUS_NO_MEMORY; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment