Changeset 66260 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Mar 27, 2017 9:58:43 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxCredProv/VBoxCredProvCredential.cpp
r66109 r66260 318 318 */ 319 319 DWORD cbLogon = sizeof(KERB_INTERACTIVE_UNLOCK_LOGON) 320 + pLogonIn->LogonDomainName.Length +321 + pLogonIn->UserName.Length +320 + pLogonIn->LogonDomainName.Length 321 + pLogonIn->UserName.Length 322 322 + pLogonIn->Password.Length; 323 323 324 #ifdef DEBUG 325 VBoxCredProvVerbose(3, "VBoxCredProvCredential::AllocateLogonPackage: Allocating %ld bytes (%d bytes credentials)\n", 324 VBoxCredProvVerbose(3, "VBoxCredProvCredential::AllocateLogonPackage: Allocating %ld bytes (%zu bytes credentials)\n", 326 325 cbLogon, cbLogon - sizeof(KERB_INTERACTIVE_UNLOCK_LOGON)); 327 #endif328 326 329 327 KERB_INTERACTIVE_UNLOCK_LOGON *pLogon = (KERB_INTERACTIVE_UNLOCK_LOGON*)CoTaskMemAlloc(cbLogon); 330 328 if (!pLogon) 331 329 return E_OUTOFMEMORY; 330 331 /* Make sure to zero everything first. */ 332 RT_BZERO(pLogon, cbLogon); 332 333 333 334 /* Let our byte buffer point to the end of our allocated structure so that it can … … 339 340 * string content but a relative offset starting at the given 340 341 * KERB_INTERACTIVE_UNLOCK_LOGON structure. */ 341 #define KERB_CRED_INIT_PACKED(StringDst, StringSrc, LogonOffset) \ 342 StringDst.Length = StringSrc.Length; \ 343 StringDst.MaximumLength = StringSrc.Length; \ 344 StringDst.Buffer = (PWSTR)pbBuffer; \ 345 memcpy(StringDst.Buffer, StringSrc.Buffer, StringDst.Length); \ 346 StringDst.Buffer = (PWSTR)(pbBuffer - (PBYTE)LogonOffset); \ 347 pbBuffer += StringDst.Length; 348 349 RT_BZERO(&pLogon->LogonId, sizeof(LUID)); 342 #define KERB_CRED_INIT_PACKED(StringDst, StringSrc, LogonOffset) \ 343 StringDst.Length = StringSrc.Length; \ 344 StringDst.MaximumLength = StringSrc.Length; \ 345 if (StringDst.Length) \ 346 { \ 347 StringDst.Buffer = (PWSTR)pbBuffer; \ 348 memcpy(StringDst.Buffer, StringSrc.Buffer, StringDst.Length); \ 349 StringDst.Buffer = (PWSTR)(pbBuffer - (PBYTE)LogonOffset); \ 350 pbBuffer += StringDst.Length; \ 351 } 350 352 351 353 KERB_INTERACTIVE_LOGON *pLogonOut = &pLogon->Logon; 354 352 355 pLogonOut->MessageType = pLogonIn->MessageType; 353 356
Note:
See TracChangeset
for help on using the changeset viewer.