- WindowStationName.Length = wcslen(ServiceWinStaName) * sizeof(WCHAR);
- WindowStationName.MaximumLength =
- WindowStationName.Length + sizeof(UNICODE_NULL);
- WindowStationName.Buffer =
- ExAllocatePoolWithTag(PagedPool,
- WindowStationName.MaximumLength,
- TAG_STRING);
- if (!WindowStationName.Buffer)
- {
- Status = STATUS_NO_MEMORY;
- ERR("Impossible to build a valid window station name, Status 0x%08lx\n", Status);
- SetLastNtError(Status);
- return NULL;
- }
- RtlStringCbCopyW(WindowStationName.Buffer,
- WindowStationName.MaximumLength,
- ServiceWinStaName);